Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 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 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 4 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 follow-up: Changed 4 years ago by jttt

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

comment:2 in reply to: ↑ 1 Changed 4 years ago by anonymous

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 follow-up: Changed 4 years ago by stoecker

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 in reply to: ↑ 3 Changed 4 years ago by anonymous

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 follow-up: Changed 4 years ago by stoecker

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

comment:6 in reply to: ↑ 5 Changed 4 years ago by anonymous

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.