[mapserver-users] queryByAttributes syntax

Berend Veldkamp b.veldkamp at zonnet.nl
Fri Jan 22 07:22:26 EST 2010


Hi,

Where can I find more information about the queryByAttributes() function? I
found http://mapserver.org/mapscript/php/index.html#layerobj-class , but it
is not very detailed. By trial and error I found that for a PostGIS layer, I
should use this syntax:

layer.queryByAttributes(map, null, "myfield='searchValue'",
mapscript.MS_MULTIPLE);

but for shapefiles, it seems it should be:

layer.queryByAttributes(map, "myfield", "searchValue",
mapscript.MS_MULTIPLE);

I am trying to write some generic code, but that's hard if there is no
single way to call this method. Also, I haven't found a way yet to do a
partial match on a shapefile (PostGIS supports 'LIKE')

Regards,
Berend Veldkamp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100122/8edd5e0e/attachment.html


More information about the mapserver-users mailing list