[josm-dev] to the devolopers of WMS-plugins
Frederik Ramm
frederik at remote.org
Thu Nov 6 18:54:11 GMT 2008
Hi,
Tobias Wendorff wrote:
> all the WMS-plugins don't send out a SRS-code to the server,
> so I've added "&SRS=EPSG:4326" to the URL (WGS84 code).
>
> My JOSM runs in Mercator (Spherical/Web Mercator)=> EPSG:3785.
>
> Even if the coordinates are equal, the projection should be
> different (the image should look distorted).
> Does JOSM currently do reprojection of incoming WMS-imagery?
No.
What you're doing is you request an EPSG4326 projected bitmap from the
server but with a height that doesn't fit. Example: Assume your JOSM map
view is 500x500 pixels and you're viewing an area around 60°N in
spherical Mercator. The area displayed is 5° wide. How high is it? The
answer is that it will be about 10° high (let us assume it's 55° to
65°). You now send a WMS request for an area of 5° by 10° in EPSG4326
with a width parameter of 500 pixels; normally the image produced would
be 1000 pixels high, but you request a 500 pixel high image, causing the
WMS server to scale (scale! not reproject) the image.
What you get is a 500x500 image that fits perfectly at the northern and
southern borders (after all, you requested 55° to 65° and you got 55° to
65°). But if you look at the scan line 250 exactly in the middle of the
image, this scan line will represent 60° - whereas you would expect
60.13° with your EPGS3785 projection, so you're about 7 pixels (or
approximately 7 kilometres at this resolution) off in the middle of the
image.
Having said that, the effect is less pronounced if you're nearer the
equator, and if you are zoomed in far then the error is way smaller than
typical GPS accuracy errors.
The proper thing for JOSM would be to add the SRS parameter based on the
current projection, and evaluate a GetCapabilities response before it
even allows you to make a WMS request with the current projection.
(Landsat, for example, will always return EPSG4326 no matter what you
request.)
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the josm-dev
mailing list