[mapserver-users] styling point shapefile for wms

Jeff McKenna jmckenna at gatewaygeomatics.com
Fri Apr 14 09:13:02 PDT 2017


Hi Derek,

Since your request is using WMS 1.3.0, the issue could be specifying 
long/lat vs lat/long in your CRS parameter of the WMS GetMap request 
(see example requests at 
http://mapserver.org/ogc/wms_server.html#coordinate-systems-and-axis-orientation).

I would also check the GetCapabilities response for any warnings.

Also, another option for testing your mapfile styling instead of your 
first link (CGI method) is to use the shp2img commandline utlity, that 
comes ready for your use in MS4W as well (see 
http://mapserver.org/utilities/shp2img.html).

Happy mapserving :)

-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 2017-04-13 10:29 PM, jmorgan3 wrote:
> Hello,
>
> I am attempting to set up a basic MapServer environment and finding
> myself such at what I think is a styling through WMS issue. I am finding
> if I call up a WMS via the following URL I get the expected results
>
>
> http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/wq/wq.map&layer=wq_stations&mode=map
>
>
> However, if I call the same WMS using
>
> http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/wq/wq.map&SERVICE=WMS&map=/ms4w/apps/wq/wq.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=wq_stations&CRS=EPSG:4326&BBOX=-87.6,30.00,-87.26,31.00&STYLES=&WIDTH=600&HEIGHT=600&FORMAT=image/png
>
> I get a blank page. Perhaps in the first URL I am not actually using
> WMS, but I am thinking the issue is more to do with how I setup or
> incorrectly my STYLE. Here is my map file for reference:
>
> #
> # Start of map file
> #
> MAP
>     NAME WQ
>     STATUS ON
>     SIZE 600 600
>     EXTENT -87.6 30.00 -87.26 31.00
>     #EXTENT -87.60 28.67 -82.65 31.07 # [minx] [miny] [maxx] [maxy]
>     IMAGETYPE PNG
>     CONFIG "MS_ERRORFILE" "/ms4w/tmp/ms_error.txt"
>     DEBUG 5
>     PROJECTION
>         "init=epsg:4326"
>     END
>     WEB
>         # change the next two lines to match your setup
>         IMAGEPATH "C:/ms4w/tmp/ms_tmp/"
>         IMAGEURL "/ms_tmp/"
>         METADATA
>             WMS_TITLE "WQ Demo"
>             WMS_ABSTRACT "This is WQ Demo"
>             WMS_ENABLE_REQUEST "*"
>             WMS_ACCESSCONSTRAINTS "none"
>             # change this value to match your setup
>             WMS_ONLINERESOURCE
> "http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/wq/wq.map"
>             WMS_SRS "EPSG:4326"
>         END
>     END
>     #Circle symbol
>     #Ref:
> http://osgeo-org.1560.x6.nabble.com/Can-t-draw-points-from-shapefile-td5070300.html
>
>     SYMBOL
>         NAME 'CIRCLE'
>         TYPE ellipse
>         FILLED true
>         POINTS
>           1 1
>         END
>     END
>     #
>     # Start of layer definitions
>     #
>     LAYER
>         NAME "wq_stations"
>         DATA 'data/ewqma_stations4326.shp'
>         STATUS ON
>         TYPE POINT
>         CLASS
>             STYLE
>                 SYMBOL 'CIRCLE'
>                 COLOR   255 1 1
>             END
>         END # CLASS
> END # LAYER
>     END # LAYER
> END # Map File
>
> Any pointers on what I am doing or interpreting incorrectly would be
> greatly appreciated.
>
> Thanks,
> Derek








More information about the MapServer-users mailing list