[postgis-users] sql/function which returns points within certain distance?

Twan Kogels twan at twansoft.com
Wed May 22 04:58:35 PDT 2002


Hello,

I have put a point layer (.shp) with many points in a postgresql database, 
i've done this with the shp2pgsql tool supplied with the postgis distribution.

When i let Mapserver load the layer with a postgis connection, all points 
appear correct.

I'm now reading the postgis/sql functions of postgis and i'm wondering if 
it is possible to create a query which returns all points within a distance 
of 10 km. from a center point.

To illustrate my question i have made a picture:
http://www.gdeesha.com/bin/center.gif

As you can see the picture contains several black points, the blue point is 
the center point. The red circle is the 10 km circle. Is it possible that a 
sql query will return only the black point in the red circle?

(The circle may also be replaced by a rectangle)

Best regards,
Twan Kogels





More information about the postgis-users mailing list