[mapserver-users] WMS GetMap request - incorrect layer ordering

John Cartwright john.c.cartwright at comcast.net
Sat Oct 15 12:02:29 EDT 2011


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


More information about the mapserver-users mailing list