Opened 17 years ago
Last modified 15 years ago
#2016 assigned enhancement
Cannot add attributes to a new ShapeObj — at Version 7
Reported by: | Owned by: | sdlime | |
---|---|---|---|
Priority: | high | Milestone: | 6.0 release |
Component: | MapScript | Version: | 4.6 |
Severity: | minor | Keywords: | |
Cc: | dmorissette |
Description (last modified by )
From the documentation it seems that the shapeObj member values (which is an array) is read-only. I have not found any function that allows to add attributes to a shapeObj which can be added to a shapefileObj and then saved.
Such enhancement would allow to fully create new layers inside Mapscript.
Change History (7)
comment:1 by , 17 years ago
Cc: | added |
---|
comment:3 by , 17 years ago
Steve, Franck and I discussed a bit about this in irc, and I think the rationale for this report was the ability to create inline features with attributes from mapscript. Is this supported? I seems desirable to me to be able to create "full featured" inline features for some purposes but Franck and I couldn't see any way of attaching regular attributes to inline features.
comment:4 by , 17 years ago
Cc: | added |
---|
Before 4.10 shapeObj have allocated 4 predefinied values that could be used through getValue and setValue by index. We have discovered that this solution may lead to memory corruption in some cases related to: http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1801 So this behaviour was modified so that initValues should be explicitly called passing the expected number of the attributes. After that, getValue and setValue can be used as usual. So creating inline features with attributes is supported now. Tamas
comment:5 by , 17 years ago
Thanks for the clarification. That was Sean's area of expertise and I hadn't payed that close of attention. Has anyone tested classifications and such based on those attributes? Steve
comment:6 by , 17 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 5.2 release |
I don't think layer classification and labelling using values set by initValues()/setValues() works yet (see http://trac.osgeo.org/mapserver/ticket/2161#comment:3)
So the real issue of this bug remains: we need to define a usable mechanism to set attribute values on an inline shape that works with layer classification and labelling.
Once something is in place for SWIG MapScript please update ticket #2161 so that we port the same thing to PHP MapScript.
comment:7 by , 17 years ago
Description: | modified (diff) |
---|