[Mapserver-users] query by record num

Steve Lime steve.lime at dnr.state.mn.us
Wed Jul 14 01:24:17 EDT 2004


There is also a INDEXQUERY CGI mode and there may well be a
corresponding mapscript method.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> Eric Bridger <eric at gomoos.org> 07/13/04 2:58 PM >>>
On Tue, 2004-07-13 at 13:41, Nikolai Vladychevski wrote:
> Hello, 
> 
> I have a shapefiles with lines or polygons and I want to query an item
by 
> its sequencial number in the shapefile, for example, I want to select
the 
> polygon number 239 on the map. I don't have any unique identifier in
the DBF 
> file. Can be a shape queried by its record number? If so how? I supose
I 
> need to use queryByAttributes(string qitem, string qstring, int mode)
call, 
> but how do I tell it to search by record number? 
> 
I'm assuming you're using mapscript.
The Layer object has a getShape(tileindex, shapeindex) method so you
could do: $shape = $layer->getShape(-1, 239).  But I guess the real
question is how to change the attributes on that shape?  You could try
getting the Layer's Class's Style object and setting its color
attributes then calling $shape->draw(). After you've already drawn the
layer.

Eric


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list