Opened 19 years ago
#1200 new defect
Cannot access class attributes directly
Reported by: | Owned by: | mapserverbugs | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapScript-PHP | Version: | 4.4 |
Severity: | normal | Keywords: | |
Cc: |
Description
I ran across this bug after creating a layer and adding points to it using addFeature() and then attempting to use queryByPoint() to find the nearest point from that layer. The problem is that, without a shapefile, no index value is set for each point shape. When getResult is called on the layer after queryByPoint, shapeindex and tileindex are both -1, and the getShape call chokes. Solutions to this problem that I'd found online involved setting the $shape->index value manually, but those solutions were in perl. That wouldn't work in PHP, as index is 'read only'. For my purposes I adjusted the shape->set() in php_mapscript.c to allow the setting of the index attribute, and now everything works great. But I'm curious as to why all of the attributes are not directly accessible. In particular, I can't find a way to set the 'values' attribute. In perl, it appears that these attributes are all directly accessible to mapscript.
Note:
See TracTickets
for help on using tickets.