[OSM-talk] all POIs within a specific radius
Frederik Ramm
frederik at remote.org
Tue Aug 2 13:26:27 BST 2011
Hi,
On 08/02/11 14:13, kenneth gonsalves wrote:
> actually I am looking for an sql query.
That would typically be done using the st_dwithin function. That
function internally makes a bounding box comparison, thereby taking
advantage of any geographic indexes you might have, and only then checks
the actual distance.
But note that the "actual distance" is always in projection units, i.e.
if you have spherical mercator then it will be approximately meters, but
not really meters.
If you want proper meters, look up st_distance_sphere and
st_distance_spheroid and/or think about converting from geometry to
geography data type.
Bye
Frederik
More information about the talk
mailing list