[postgis-users] st_dwithin

Emilie Laffray emilie.laffray at gmail.com
Tue May 11 05:37:14 PDT 2010


On 11 May 2010 07:34, Malm Paul <paul.malm at saabgroup.com> wrote:

>  Hi,
> I have a database stored in WGS84 EPSG:4326
> I would like ti find objects within a distance from a lat/lon point.
> 1) If i use 1 degree as the distance, will I then get an eliptic search
> area?
> 2) Will i find objects on the other side of the Datum shift border if I
> enter a point like lat=60°, lon= -179,5° with a distance of 1°?
> 3) Hov do I enter a lat/lon point and a distance in meters?
>
>

If you want to do something that works but is relatively inefficient for 3,
you can do the following:

ST_DWithin() AND ST_DistanceSphere() < distance in meters

Of course, you would have to make sure that the search radius is big enough
to correspond to your search in meters. Of course, it works only for points
due to ST_DistanceSphere.
If you want to perform something with any geometry, look at postgis 1.5 and
the new geography type.

Emilie Laffray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100511/2fe82da3/attachment.html>


More information about the postgis-users mailing list