[OpenLayers-Users] Utilize DWITHIN spatial filter in OpenLayers

smilectt smilelizy at gmail.com
Sun Jan 5 19:28:30 PST 2014


Hi, all , I'm new to geoserver and openlayers,

I'm using OpenLayers.Filter.Spatial.DWITHIN
currentLayer is created from geoserver through a WFS request

 currentLayer.filter=new OpenLayers.Filter.Spatial({
                    type:OpenLayers.Filter.Spatial.DWITHIN,
                    property: "the_geom", 
                    value: new OpenLayers.Geometry.Point(lon,lat),
                    distance: maxDis,
                });

Some other topics mentioned the geoserver does not support specify the
distanceUnits and in fact the 
maxDis is the degree distance to the center point.

I didn't quite get it, does the degree distance mean the longitude/latitude
degree differences with the point we are comparing?

It appears the maxDis has to be like 0.0003(very small) to be able to filter
the point

but how can I fix it that I can filter them according to the value expressed
in meters (as it makes more sense)

Any suggestions ?
Thanks a lot 





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Utilize-DWITHIN-spatial-filter-in-OpenLayers-tp5096493.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list