[mapserver-users] [EXTERNAL] WMS SRS as variable
Schylberg Lars
lars.schylberg at saabgroup.com
Mon Feb 9 06:14:31 PST 2015
Thanks Jukka,
It works! I had missed the detail that you could have space separated list in wms_srs specification.
Now I have to see if I can the layers to work also in the cascading WMS services.
You are right about the google proj. I should change to 3857 even if I full control right now.
/Lars
From: Rahkonen Jukka (MML) [mailto:jukka.rahkonen at maanmittauslaitos.fi]
Sent: den 9 februari 2015 12:03
To: Schylberg Lars; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] [EXTERNAL] WMS SRS as variable
Hi,
Ok, I start to understand little by little. It is not about making your Mapserver to support several SRS in output, it is about making your Mapserver to send GetMaps to cascaded remote WMS services by using the most reasonable SRS in the request, that is, usually the same SRS as used for output so that Mapserver does not need to do interim warping.
I suggest to include enough from the mapfile for making the questions and answers understandable. Let's take this sample from http://mapserver.org/ogc/wms_client.html
LAYER
NAME "country_bounds"
TYPE RASTER
STATUS ON
CONNECTION "http://demo.mapserver.org/cgi-bin/wms?"
CONNECTIONTYPE WMS
METADATA
"wms_srs" "EPSG:4326" #<=== THIS CAN BE A SPACE SEPARATED LIST
"wms_name" "country_bounds"
"wms_server_version" "1.1.1"
"wms_format" "image/gif"
END
END
You would like to use variable substitution in "wms_srs" "EPSG:%srs%". That is not possible because there are only a few places where substitutions can be used. See http://mapserver.org/cgi/runsub.html and Parameters supported.
However, if you want to support output in 'EPSG:32633 EPSG:3006 EPSG:900913 EPSG:4326' you can use the same list in the "wms_srs" metadata item of the cascaded WMS layer. Then if you want output in EPSG:32633 Mapserver will use the same SRS in GetMaps that it is creating and I suppose that it is your goal.
Be aware with EPSG:900913, recent Mapservers do not support it out-of-the-box but you must edit the epsg projection file manually. It would better to use EPSG:3857 instead but then the remote WMS should also understand the meaning of EPSG:3857 .
If request rewriting is absolutely needed, like you want to send out EPSG:3857 but remote WMS understands only EPSG:900913 or you need to do some other tailored mapping between the codes, then I suppose you should use some miraculous mapscript for rewriting the mapfile.
-Jukka Rahkonen-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150209/01949538/attachment.htm>
More information about the MapServer-users
mailing list