Opened 20 years ago
Closed 20 years ago
#846 closed defect (fixed)
Setting classindex of a feature added to mapfile has no effect...
Reported by: | sdlime | Owned by: | sdlime |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | MapServer C Library | Version: | 4.3 |
Severity: | critical | Keywords: | |
Cc: | sgillies@… |
Description
The fix (need to take into account scale with the if-then): int msShapeGetClass(layerObj *layer, shapeObj *shape, double scale) { int i; if(layer->connectiontype == MS_INLINE) return shape->classindex; for(i=0; i<layer->numclasses; i++) { if(scale > 0) { // verify scale here if((layer->class[i].maxscale > 0) && (scale > layer->class[i].maxscale)) continue; // can skip this one, next class if((layer->class[i].minscale > 0) && (scale <= layer->class[i].minscale)) continue; // can skip this one, next class } if(layer->class[i].status != MS_DELETE && msEvalExpression(&(layer->class[i].expression), layer->classitemindex, shape->values, layer->numitems) == MS_TRUE) return(i); } return(-1); // no match }
Change History (9)
comment:1 by , 20 years ago
Cc: | added |
---|
comment:3 by , 20 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Steve, my InlineFeatureTestCase.testAddPointFeature segfaults after this commit. class InlineFeatureTestCase(MapTestCase): """tests for issue http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=562""" def testAddPointFeature(self): """adding a point to an inline feature works correctly""" inline_layer = self.map.getLayerByName('INLINE') p = mapscript.pointObj(0.2, 51.5) l = mapscript.lineObj() self.addPointToLine(l, p) shape = mapscript.shapeObj(inline_layer.type) self.addLineToShape(shape, l) inline_layer.addFeature(shape) msimg = self.map.draw() filename = 'testAddPointFeature.png' msimg.save(filename)
comment:4 by , 20 years ago
steve, problem is that when you reference layer->class[i], i is uninitialized.
comment:5 by , 20 years ago
Severity: | normal → major |
---|
comment:6 by , 20 years ago
Priority: | high → highest |
---|---|
Severity: | major → critical |
Marking as critical. Inline layers are broken, can be verified using shp2img from the mapserver build directory [sean@lenny mapserver]$ ./shp2img -m tests/test.map -o tests/test.png Segmentation fault
comment:7 by , 20 years ago
Oops, stupid on my part. I can't compile on this end (I'm in Brasil) and typo slipped through. Try it now. Steve
comment:9 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.