[mapserver-users] Re: [mapserver-dev] MapScript resultsGetShape confusion

Daniel Morissette dmorissette at mapgears.com
Mon May 31 23:02:16 EDT 2010


Hi Christian,

resultsGetShape() should be used only with shape ids received as part of 
a query/resultset. The way queries work has changed in V5.6, and now 
shape ids returned by a resultset are relative to the resultset and not 
to the global dataset. That's why the new resultsGetShape() method was 
created.

OTOH getFeature/getShape continue to work, but they work with absolute 
shape ids, so you should use them when you read shapes by id and not 
going through a query/resultset.

In 5.6.2 or in 5.6.3, some of the drivers that were still not using the 
new query mechanism properly have been fixed and that could explain the 
different behavior that you get in v5.6.3.

Daniel


Christian Jauvin wrote:
> Hi,
> 
> I've been using the new layerObj.resultsGetShape function with MS >=
> 5.6.0, both with Python and PHP MapScript.
> 
> (1) My first issue is that it seems that something changed with
> version 5.6.3 of Python MS (I'm using MS4W beta 11) because calls to
> that function that used to work now hangs the server. The PHP
> equivalent code still works fine though.
> 
> (2) My second issue is with the signature difference between the
> Python and PHP versions of the same function: if I want to retrieve a
> certain queried shape in Python, I do this:
> 
> shp = shapeObj(MS_SHAPE_NULL)
> layer.resultsGetShape(shp, target_shpindex)
> 
> and then shp is what I want, whereas in PHP it takes only one
> argument, and returns the desired shape. Why is that?
> 
> (3) My third issue is that to make my first issue works, I noticed
> that I can simply use layerObj.getFeature instead, which seems to be
> doing the same job. What is the difference between those?
> 
> Best regards,
> 
> Christian
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev


-- 
Daniel Morissette
http://www.mapgears.com/


More information about the mapserver-users mailing list