[OpenLayers-Users] Utilize DWITHIN spatial filter in OpenLayers

Phil Scadden p.scadden at gns.cri.nz
Sun Jan 5 20:04:09 PST 2014


On 6/01/2014 4:28 p.m., smilectt wrote:
> 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.
You got it. Actually, maxDis will be interpreted as being in the units 
of layers you are querying. If the native spatial reference is in 
degrees, then it will be interpreted as degrees.
> I didn't quite get it, does the degree distance mean the longitude/latitude
> degree differences with the point we are comparing?
Yes.
> but how can I fix it that I can filter them according to the value expressed
> in meters (as it makes more sense)
It depends on how precise and how general you want to be. Crudely, you 
can divide the distance in meters
by 1860*60 (1 minute (latitude on sphere) = 1 nautical ml = 1.86km). Not 
going to be accurate in mid/high latitudes. Better is convert point to 
meters, create another point  maxDIS away in meters, convert that point 
back to lat/long and then calculate maxDIS from pythag.


Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.



More information about the Users mailing list