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

maw269 maw269 at gmail.com
Thu Feb 2 11:54:44 EST 2012


Excellent,

I am late getting back to everyone thanking them for their help. I always
want to revisit the thread when I solve the proplem to post the solution.

I was able to use the spatial filter on the WFS request to filter only a
small part of the multipolygon that my point resided in. This WFS response
was then small enough for the client to handle.
I want to revisit the getfeatureinfo to see if I can get that to work also. 
Here is the code that allowed me to pull the the polygon for my test point.

			wfslayer = new OpenLayers.Layer.Vector("Flood Vector", {
				strategies: [new OpenLayers.Strategy.BBOX()], 
				visibility: false,				
				protocol: new OpenLayers.Protocol.WFS({
						  url:  url,
						  featurePrefix: "dfirm",
						  featureType: "s_fld_haz_ar2",
						  version: "1.1.0",
						  srsName: "EPSG:900913"
						  }),
				filter: new OpenLayers.Filter.Spatial({
						type: OpenLayers.Filter.Spatial.INTERSECTS,
						property: 'the_geom',
						value: point})		
			});	
Where the 'url' is the url to my WFS server and 'point' is an OpenLayers
Point Geometry
point = new OpenLayers.Geometry.Point(-8911615.2651595,4935047.5500005);

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


More information about the Users mailing list