[OpenLayers-Users] Re: How to test if a point is within WMS layer?

Robert Sanson Robert.Sanson at asurequality.com
Sun Jan 29 14:42:21 EST 2012


Why not use a GetFeatureInfo request using your x,y inside a small bbox and see if you get attributes returned relating to one of the polygon geometries in the WMS layer? Take your x,y point, create a small bbox round it and then use the width and height parameters to represent your point in the middle of the bbox eg.

http://myserver/cgi-bin/mapserv.exe?service=WMS&version=1.1.1&request=GetFeatureInfo&LAYERS=crs_parcels&QUERY_LAYERS=crs_parcels&INFO_FORMAT=text/plain&SRS=EPSG:2193&BBOX=1754813,5850304,1755013,5850504&WIDTH=20&HEIGHT=20&X=10&Y=10

Robert Sanson

>>> maw269 <maw269 at gmail.com> 27/01/2012 10:23 a.m. >>>
Andreas wrote:"That's right. If that's not what you need, then you probably
need
topology rule enforcement. I assume you want to persist the user
generated geometries on your GeoServer as well? That can be done as
part of WFS transactions, using pre- and post-transaction hooks on the
server. The first step would be to see why your GeoServer does not
respond to WFS request, but that's a question for the geoserver-users
list."

I don't have any user generated geometries for this scenario. I simply want
to test whether a point is within a polygon geometry sitting on GeoServer. I
figured out the GeoServer is actually responding to the WFS request for the
polygon but there are LOTS of vertices so it not feasible to use the WFS
approach to determine whether the point is within the polygon.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-test-if-a-point-is-within-WMS-layer-tp4341265p4341729.html 
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/openlayers-users



This email and any attachments are confidential and intended solely for the addressee(s). If you are not the intended recipient, please notify us immediately and then delete this email from your system.

This message has been scanned for Malware and Viruses by Websense Hosted Security.
www.websense.com


More information about the Users mailing list