I want to use a map service which is available in WMS format. The server is Mapserver, and the spatialreference of the map service is 4326.
I wish to use it in a slippy map (web based Javascript Map), with a custom projection. This projection does not have a EPSG code. Is it possible to request the output, by providing the well known text for the projection?
Update
I can see that the GetMap request has a SRS paramter, and usually an EPSG code is supplied, like this: SRS=EPSG:4326. Can we pass something else to this SRS Paramter?
Best Answer
It really depends on the capabilities of the mapserver as to what CRSes it supports (in the WMS 1.3.0 spec,
CRS
is used as the parameter instead ofSRS
, but they're essentially the same thing for your purposes). When you make a GetCapabilities request, part of thelayers
tag will be one or morecrs
tags which will list the CRSes supported by that layer. The WMS spec describes theCRS
,EPSG
, andAUTO
namespaces (so your CRS parameter might look likeCRS=CRS:1
orCRS=EPSG:4326
), but I think the server is free to use whatever it likes. Practically speaking however, you'll rarely see anything other than theEPSG
namespace.But that said, if you don't mind getting your hands dirty, and you have a server to run it on, one possibility would be to set up your own MapServer that becomes a WMS client for the originating server - a sort of proxy server. You can then provide it whatever projection you like using the
PROJECTION
keyword.This does mean however that a client application will not be able to get at the GetCapabilites metadata for the originating server unless you write some Javascript or similar to communicate with both servers. Alternatively, you could write some pass-through code on your server that modifies requests and/or responses, so it masquerades more completely as the originating server.