Iterating layer features in mapscript effectively

Frank Warmerdam warmerdam at POBOX.COM
Wed Sep 28 20:40:24 EDT 2005


On 9/28/05, Tamas Szekeres <szekeres.tamas at freemail.hu> wrote:
> Hi list,
>
> I would like to iterate the features of the layers with mapscript in order
> to represent the attributes (of the features drawn) in table format for
> the user. I think the most effective way of this work would be supporting
> the proper functions could be mapped to msLayerWhichShapes and
> msLayerNextShape similar to msDrawLayer accesses features. The only way I
> could find is to call layeobj.getFeature which calls msLayerGetShape to
> provide random access to features, however there is no interface to find
> out the range of valid record numbers.
> Performing querying by rect would be an other way, but it involves much of
> overhead by copying all of the features into the result cache.

Tamas,

To the best of my knowledge the various queries just copy the set of
matching feature ids into the results cache, not the whole features
themselves.

Of course, as I have indicated before, I think there are significant
performance issues with the current two pass query approach since
fetches by feature id are expensive from some backend data providers.
So it would indeed be desirable to have the direct access to features
that the drawing functions have accessable to mapscript.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-dev mailing list