[mapserver-users] MapServer 4.8.3: MapScript setProjection

Simon Greig simon_greig at uk.ibm.com
Fri Apr 4 10:50:21 EDT 2008


Daniel,

I think I owe you an apology!

In your email last week you said:

> Sounds like you may have a layer which uses CONNECTIONTYPE WMS. This is 
> a layer that is actually a connection to a remote WMS service, and one 
> of the things MapServer needs to know in order to build a succesful 
> GetMap request to that remote server is the SRS supported by that 
server.

I had said that this was not possible.

The database team reported that they suspected that we get the projection 
error for layers that have been pre-rendered into rasters.  We inspected 
the code and found that if the layer is pre-rendered then our custom WMS 
servlet replaces the layer definition supplied by our data catalogue 
database with a hardcoded raster layer.

In order to serve up the raster, the code replaces the DB loaded layer 
with a new layer with a connection type of "WMS" - it supplies the URL of 
our WMS server (i.e. it calls itself)

So my plan to fix this was to update the code that currently says:

FOR EACH layer
   IF inputdata.projection <> epsg:27700    // It always is 27700 in our 
reference data so the setProjection is never called
      layer.setProjection ("init=epsg:27700")
   END IF
   etc etc
END FOR

Change the above to say:

FOR EACH layer
   IF inputdata.projection <> epsg:27700   OR inputdata.connectionType = 
WMS
      layer.setProjection ("init=epsg:27700")
   END IF
   etc etc
END FOR

As you say, if it is mandatory for WMS connections to have a projection 
then this makes sense.  It means we can't get our performance savings for 
raster layers but that is a constraint and we can make savings elsewhere.

Thank you for the advice.

Regards
Simon






Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080404/947accde/attachment.html


More information about the mapserver-users mailing list