[mapserver-users] Inconsistency between 5.4 and 5.2.1 concerning WhichShapes()?

Jim Strevinas voas_acc at hotmail.com
Mon Apr 27 18:26:06 PDT 2009


Hello list, I recently migrated to 5.4. I observed the following inconsistency 
and I would be grateful if someone can duplicate the problem too.
In my (mapscript python) code i manually grab layer features using:

layer.open()
status = layer.whichShapes(map.extent)
while (1):
       shape = layer.nextShape()
       if shape==None: 
                break
       print shape.numvalues

The last print returns the number of non-spatial attributes. 
In mapserver 5.2.1 it is returned correctly but in 5.4 is always 0
just like all the non spatial values are all null. One could also
observer that:

layer.open()
print layer.numitems   # Return the right value always

status = layer.whichShapes(map.extent)
print layer.numitems   # Returns 0 ONLY in 5.4

My workaround now is to temporary store the whichShapes() returned
features' indexes in a list and later access using layer.getFeature(i) which preserves
the existance of non-spatial. I don;t know yet if this problem arised only
for me, but i thought it would be wise to inform.


_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090428/9da63104/attachment.htm>


More information about the MapServer-users mailing list