This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Radius ST_DWITHIN query at given location using OSM data

0

I imported OSM data using osm2pgsql and querying it using postgis extentsion but struggling to get some decent output.

I would like to query for ATMs within 500 meters at location long/lat (-0.1470123 51.5149226) (London) Here is my query

SELECT name, ST_AsText(ST_Transform(way,4326)) FROM planet_osm_point WHERE amenity = 'atm' AND ST_DWITHIN(way, ST_TRANSFORM(ST_SETSRID(ST_MAKEPOINT(-0.1470123,51.5149226),4326),900913), 500);

Can you help?

asked 19 Dec '18, 14:03

mrparadox's gravatar image

mrparadox
11445
accept rate: 0%

Source code available on GitHub .