#2291 closed enhancement (fixed)
[PATCH] Teach WMSGrabber to understand formatting patterns in the WMS URL
Reported by: | 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)
Change History (7)
follow-up: 2 comment:1 by , 16 years ago
by , 16 years ago
Attachment: | 0001-Teach-WMSGrabber-to-understand-formatting-patterns-i.patch added |
---|
comment:2 by , 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:4 by , 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...
follow-up: 6 comment:5 by , 16 years ago
I do not use git and also sometimes forget additional comments. Thats life :-)
comment:6 by , 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.
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