[mapserver-users] MapScript WMS request

Daniel Morissette dmorissette at mapgears.com
Thu Sep 8 21:28:16 EDT 2011


On 11-09-08 09:02 PM, Mr. Puneet Kishor wrote:
>
> On Sep 8, 2011, at 7:43 PM, Daniel Morissette wrote:
>>
>> Maybe call $map->save("/tmp/my.map") in your script after the map and layer have been populated and paste the result... that may give us a hint...
>>
>
> wow! this is a super-awesome debugging technique. I have sent you the map file off list to not pollute the entire list serve.
>

I was able to reproduce the issue with the copy of the mapfile you sent 
off-list.

It turns out that mappostgis.c's msPostGISLayerGetExtent() is hardcoded 
to always return

{minx = -25000000, miny = -25000000, maxx = 25000000, maxy = 25000000}

...and then it returns MS_SUCCESS.

I think this function should either be left unimplemented (this way 
MapServer would fallback on other mechanisms), or return MS_FAILURE to 
indicate to the calling code that it didn't do anything useful.

A quick search indicates an open ticket about the issue:

http://trac.osgeo.org/mapserver/ticket/3585

You could bump the ticket and hope someone works on it at the FOSS4G 
code sprint next week.

The short term fix for you would be to set the "ows_extent" metadata in 
your layer:

     METADATA
       "ows_extent" "-180 -90 180 90"
    ...
     END

-- 
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000



More information about the mapserver-users mailing list