[mapserver-users] Is there a problem with layers when serving WMS?
Jeff McKenna
jmckenna at gatewaygeomatics.com
Fri Jun 25 04:08:01 PDT 2010
Jeff,
If I were you I would be degugging my mapfile with the shp2img
commandline utility. You can read the usual debugging steps at:
http://www.mapserver.org/optimization/debugging.html#step-5-test-your-mapfile
Also, if you are having problems with scales, you might want to create a
small mapfile with only that one problem scale (in other words remove
all scale parameters from mapfile) and then test with shp2img to make
sure your labels and features are drawn correctly.
Then once you have shp2img working good (you can also pass different
extents to the shp2img utility so that you can test your mapfile at
different extents/scales) you should then start testing your WMS service.
For testing a WMS service, the best way is to manually generate a
GetCapabilities URL in a browser, verify its response is valid, then
manually generate a GetMap URL in a browser for one layer. (this avoids
any issues with WMS clients like QGIS).
Once your manual URLs are working, then you can test in a WMS client,
such as QGIS.
(those debugging steps may be slow, but I do that for every WMS instance
I set up)
Have a great weekend.
-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
Jeff Dege wrote:
> I'm putting together a map via Mapserver and WMS (MapServer version
> 5.6.1 on Ubuntu 10.04), serving a set of shapefiles.
>
>
>
> The basic approach is to have a pair of layers for each class of
> highways - interstate, US highways, state highways, local roads, etc.
> One layer in each pair draws the geometry, the other draws the labels.
> In this way, the user can turn the labels on and off, as needed.
>
>
>
> I'm having a problem with highway labels showing up nowhere near where
> the highways are. At my outermost zoom, all I'm displaying is the major
> highway geometry and the interstate names. That works OK.
>
>
>
> When I zoom in a bit, to where I start displaying the US highway names,
> I see names all over the place, drawn where there are no geometries. I
> zoom in a bit more, and they go away. (I'm viewing this with Quantum
> GIS, loading the maps as WMS layers).
>
>
>
> To help track down what is going on, I took one of the names, did an
> "ogrinfo -where" to identify that there was, in fact, a featured with
> that name in the US highways shapefile. I then extracted just those
> features into a new shapefile, using ogr2ogr, and then loaded that as a
> vector layer in Quantum GIS. The aim was to find out where the feature
> that matched that name actually was.
>
>
>
> It was nowhere near the label. I set the new vector layer to draw in
> red, and it was easy to see. With a label from the WMS properly drawn
> alongside. But 75+ miles away, 600+ pixels across the map, was another
> label for that feature, nowhere near the feature it was supposed to be
> describing.
>
>
>
> I've never seen anything quite like this. But then, I'm just figuring
> out how to use mapserver to serve WMS.
>
>
>
> Are there any known "gotchas", when drawing label layers in WMS?
More information about the MapServer-users
mailing list