Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2291 closed enhancement (fixed)

[PATCH] Teach WMSGrabber to understand formatting patterns in the WMS URL

Reported by: mcdmx@… Owned by: team
Priority: major Milestone:
Component: Plugin Version: latest
Keywords: WMSPlugin Cc:

Description

Some WMS servers are a little picky about the case of parameters, e.g.
they insist that the 'bbox' parameter must be all uppercase. To enable
a little more control over how the URL is formed, this patch allows
the user to put placeholders in the WMS-URL that will be replaced by the
corresponding parameters:

  {0}   current projection
  {1}   bbox
  {2}   image width
  {3}   image height

A URL with place-holders would look something like this:

   http://myserver/wms?service=wms&version=1.1.1&request=GetMap&layers=1&styles=&srs={0}&format=image/png&BBOX={1}&width={2}&height={3}

The code first checks if the URL contains at least the bbox-placeholder ({1}) before formatting the string accordingly. If the placeholder is not present, the old method of appending bbox- and size- parameters
is used.

Attachments (1)

0001-Teach-WMSGrabber-to-understand-formatting-patterns-i.patch (3.5 KB ) - added by anonymous 16 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by jttt, 16 years ago

Btw. do you know that using StringBuffer to construct bbox is actually slower than simple "a" + "b"? Java compiler would do that optimalization by itself and it would use StringBuilder that is faster than StringBuffer. See http://aaronz-sakai.blogspot.com/2007/12/strings-and-stringbuilder-optimizations.html

in reply to:  1 comment:2 by anonymous, 16 years ago

Replying to jttt:

... it would use StringBuilder that is faster than StringBuffer.

Thanks for the hint. I have attached a new version of the patch using simple String concatenation.

comment:3 by stoecker, 16 years ago

Resolution: fixed
Status: newclosed

In [o14110].

in reply to:  3 comment:4 by anonymous, 16 years ago

Dirk,

Thanks for applying the patch. What's the reason you did not take over my commit message (which explained in detail how the new feature works)? Also, giving proper attribution to the original patch author would be appreciated...

comment:5 by stoecker, 16 years ago

I do not use git and also sometimes forget additional comments. Thats life :-)

in reply to:  5 comment:6 by anonymous, 16 years ago

Replying to stoecker:

I do not use git and also sometimes forget additional comments. Thats life :-)

Maybe you should start using it? ;-) The git<->svn integration works great and is really simple to use. You then can work on your stuff locally (offline), commit often, ammend (fix) mistakes in the previous commit, combine multiple commits into a single one, and only commit (push) your changes to the SVN repo when you're ready.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.