[mapserver-users] WMS GetMap request - incorrect layer ordering
John Cartwright
john.c.cartwright at comcast.net
Sat Oct 15 09:34:14 PDT 2011
Following up on this a bit, it appears that
with shp2img:
1) order of LAYERs defined in the map file matters, order of the parameters in the "-l" parameter does not.
2) "STATUS default" causes a layer to always be drawn in the expected order.
with the WMS GetMap request:
1) order of LAYERs defined in the map file does not matter, but the order in the "layers" request parameter does.
2) "STATUS default" causes a layer to always be drawn, but at the bottom of the stack. Presence or order of a "STATUS default" layer in the "layers" request parameter does not change it's position nor does redefining it's position in the map file.
--john
On Oct 15, 2011, at 10:02 AM, John Cartwright wrote:
> Hello All,
>
> I'm finding a difference between the image produced by shp2img and a WMS GetMap request. The image produced by shp2img looks as I expect honoring the order in which LAYERS are defined in the map file and the STATUS value. However, the WMS request does not seem to respect the order of the LAYERs, always drawing the polygons first regardless of the order defined in the map file or that of the WMS LAYERS request parameter.
>
> Here's a representative WMS request:
>
> http://localhost/cgi-bin/basicworld?request=getmap&service=wms&width=500&height=250&bbox=-180,-90,180,90&srs=EPSG:4326&version=1.1.1&layers=countries&format=png
>
> Both the cities and countries layers display as you'd expect, but the countries draw on top of the cities contrary to what I'd expect and different that in the shp2img output.
>
> I'm using mapserver version 6.0.1 and I've tried various versions of WMS. Can someone please examine the map file below and point out what I'm doing wrong?
>
> Thanks!
>
> --john
>
>
> MAP
> NAME basicworld
> SIZE 720 360
> EXTENT -180 -90 180 90
> UNITS DD
> SHAPEPATH "/Users/jcc/shapefiles"
> IMAGETYPE PNG
>
> WEB
> IMAGEPATH "/Library/WebServer/Documents/output"
> IMAGEURL "/output/"
>
> METADATA
> "ows_title" "BasicWorld Server"
> "ows_onlineresource" "http://localhost/cgi-bin/basicworld?" ##required
> "ows_srs" "EPSG:4326"
> "ows_onlineresource" "http://localhost/cgi-bin/basicworld?" ## Recommended
> "ows_enable_request" "*"
> END
> END
>
> PROJECTION
> "init=epsg:4326" ##required
> END
>
> SYMBOL
> NAME 'circle'
> TYPE ELLIPSE
> POINTS 1 1 END
> FILLED TRUE
> END
>
> LAYER
> NAME countries
> TYPE POLYGON
> STATUS on
> DATA "country"
> CLASS
> OUTLINECOLOR 0 0 0
> COLOR 167 167 167
> END
> END # layer
>
> LAYER
> NAME cities
> TYPE POINT
> STATUS default
> DATA "cities"
> CLASS
> SYMBOL 'circle'
> SIZE 6
> COLOR 204 153 255
> END
> END # layer
>
> END # Map File_______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list