Hi Rich, you can do this with the CGI or MapScript and it's quite easy with 
OpenLayers. All versions support queries using polygons and version 5.6 takes a 
WKT representation. Here's an example url:

  
http://yourserver.com/cgi-bin/mapserv56?map=parcels.map&mapext=295574.87922705%201999971.0144928%20492425.12077295%202091028.9855072&mode=nquery&qlayer=parcels&mapshape=POLYGON%28%28421405.79710145%202049183.5748792%2C428183.57487923%202043289.8550725%2C431425.12077295%202043289.8550725%2C430835.74879227%202047415.4589372%2C429067.63285024%202051246.3768116%2C424057.97101449%202051246.3768116%2C421405.79710145%202049183.5748792%29%29

The nice thing about WKT is that you can just use the OpenLayers asText method 
for the drawn shape to create it. Alternatively you can define a polygon using 
a simple syntax MapServer provides. Svn trunk supports line and point (multiple 
part) shapes as well via WKT. Contact me off list if you need a more specific 
example.

Steve
________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Richard Greenwood 
[[email protected]]
Sent: Wednesday, December 16, 2009 6:57 PM
To: mapserver
Subject: [mapserver-users] polygon select

I need to create a tool that will allow the user to draw an arbitrary
polygon, and the select objects intersecting that polygon. I'm using
OpenLayers, MapServer and PostGIS. Right now I'm trying to figure out
what protocol will support this operation. I don't think this can be
done with "classic" MapServer, nor with WMS. Am I correct? So do I
need to use WFS-T to get the polygon from the browser and pass it to
PostGIS to do the query? Are there any other routes that I should be
exploring?

Thanks,
Rich

--
Richard Greenwood
[email protected]
www.greenwoodmap.com
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to