[mapserver-dev] Regression in 5.6.4

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Mon Jul 12 10:00:02 EDT 2010


I'm confused, is this a 5.6 regression or a 5.6.4 regression?

Steve

________________________________________
From: mapserver-dev-bounces at lists.osgeo.org [mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Stephen Woodbridge [woodbri at swoodbridge.com]
Sent: Saturday, July 10, 2010 11:02 AM
To: mapserver-dev
Subject: [mapserver-dev] Regression in 5.6.4

I'm not sure when this regression crept in because I'm converting a lot
of older apps over to use 5.6.4. But on 5.2.2 I could draw a layer with
NullShape items in a shapefile without a problem and on 5.6.4 it dies
with a general error message.

msDrawMap(): Image handling error. Failed to draw layer named 'Linear
Water'. msDrawShape(): General error message. Only polygon or line
shapes can be drawn using a line layer definition.

In general, since mapserver is designed for drawing data and not
validating it or being a GIS system in general. I think we should just
step over these records. If we want to be more helpful AND the user has
DEBUG truned on than it would be helpful to say what file and what
record is a NullShape.

I have a huge tileindex that I converted to script like:
# shpdump ./afghanistan_p/major_roads/aflw | grep Shape:
with 128 files and anyones guess on the number of records.

woodbri at carto:/u/data/leaddog$ dbfdump tidx-lw.dbf > bbb
woodbri at carto:/u/data/leaddog$ vi bbb
woodbri at carto:/u/data/leaddog$ sh bbb | grep -v Arc
Shape:0 (NullShape)  nVertices=0, nParts=0
Shape:1 (NullShape)  nVertices=0, nParts=0

Here is a patch that seems to fix this:

woodbri at carto:/u/software/mapserver-5.6.4$ diff -Naur mapdraw.c
mapdraw.c-orig
--- mapdraw.c   2010-07-10 11:53:17.000000000 -0400
+++ mapdraw.c-orig      2010-07-10 11:57:27.000000000 -0400
@@ -964,7 +964,7 @@
    while((status = msLayerNextShape(layer, &shape)) == MS_SUCCESS) {

        shape.classindex = msShapeGetClass(layer, &shape,
map->scaledenom, classgroup, nclasses);
-    if((shape.type == MS_SHAPE_NULL) || (shape.classindex == -1) ||
(layer->class[shape.classindex]->status == MS_OFF)) {
+    if((shape.classindex == -1) ||
(layer->class[shape.classindex]->status == MS_OFF)) {
         msFreeShape(&shape);
         continue;
      }


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

-Steve W
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev


More information about the mapserver-dev mailing list