[GIS] How to request an output from a WMS service in a non-standard projection

coordinate systemwms

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 of SRS, but they're essentially the same thing for your purposes). When you make a GetCapabilities request, part of the layers tag will be one or more crs tags which will list the CRSes supported by that layer. The WMS spec describes the CRS, EPSG, and AUTO namespaces (so your CRS parameter might look like CRS=CRS:1 or CRS=EPSG:4326), but I think the server is free to use whatever it likes. Practically speaking however, you'll rarely see anything other than the EPSG 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.