[postgis-users] Query all places within a given distance around a reference point

Sebastien ARBOGAST sebastien.arbogast at gmail.com
Wed Dec 19 12:46:36 PST 2007


It's the first time I play with a GIS database,
and I need to perform some simple query. I could probably figure it
out myself but the amount of documentation, specifications and
standards to read is really frightening. So maybe someone can help me
here.

In my PostGIS database, I have a 'place' table whose
'location' column is a geometry (corresponding to a point).
The inputs of my query are:
- a reference POINT(lat,lon,alt) ref
- a distance d

Now I would like to write a query to find all the PLACE's
whose location loc is such that the geodetic distance between ref and
loc is less than a given distance d.

How would I write such a query?

-- 
Sébastien Arbogast

http://www.sebastien-arbogast.com



More information about the postgis-users mailing list