[OpenLayers-Users] WMS and Mercator projection

christopher.schmidt at nokia.com christopher.schmidt at nokia.com
Tue Jun 1 07:20:51 EDT 2010


On Jun 1, 2010, at 6:51 AM, ext Joosep-Georg Järvemaa wrote:

> 2010/6/1 Andreas Hocevar <ahocevar at opengeo.org>:
>>>>> 
>>> So you're saying that this JOSM-like behaviour where I have the
>>> display picture in EPSG:3857 and am working with real coordinates is
>>> not possible at all with OpenLayers?
>> 
>> Exactly. This is why I showed you the other approach - requesting the tiles in the appropriate projection.
>> 
>> In general, reprojecting images on the client needs processing power. Browsers don't have a lot of that.
> 
> Well, it's just beyond my understanding how can JOSM do that and why
> can OpenLayers not -- only thing what has to be done is ask the image
> from the WMS server -- and the server already serves the image in
> right projection what I want to see.
> 
> The link I'm dragging along is not constructed by myself but is a real
> working URI grabbed from JOSM debug output --
> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
> 
> And looking at all those Mercator-examples for OpenLayers something
> tells me that it must be possible... Google serves images in Mercator,
> right? So does the server at maaamet.ee -- you just have to ask for
> the image with EPSG:4326 and real coordinates.

These images are not mercator. I'm not sure why you think they are. It's possible that you think this because JOSM will allow you to set the projection to Mercator. When it does this, it *reprojects the source image*, by stretching it. This is something that OpenLayers does not have the ability to do, because you can't (practically) reproject image data in Javascript.

> How hard can be translating coordinates from one EPSG to another? Some
> OpenLayers examples show some coordinates-translation being done... I
> just can not understand how can JOSM have that "computing power" and
> browser running on very same machine suddenly does not.

Coordinates are easy. Images are hard.

> My final goal is to start drawing vector data from OSM on that
> maaamet.ee WMS layer.

In which case, you don't need anything to be in mercator. OSM coordinates are 4326. The WMS is 4326. What is the problem, exactly?

Regards,
-- 
Christopher Schmidt
Nokia




More information about the Users mailing list