Skip to content

Instantly share code, notes, and snippets.

@booo
Created December 21, 2011 14:39
Show Gist options
  • Select an option

  • Save booo/1506254 to your computer and use it in GitHub Desktop.

Select an option

Save booo/1506254 to your computer and use it in GitHub Desktop.
SELECT
planet_osm_point.name,
ST_Distance(
Geography(ST_Transform(planet_osm_point.way,4326)),
Geography(ST_Transform(ST_Centroid(planet_osm_polygon.way),4326))
)
FROM
planet_osm_polygon, planet_osm_point
WHERE
ST_DWithin(
Geography(ST_Transform(ST_Centroid(planet_osm_polygon.way),4326 )),
Geography(ST_Transform( planet_osm_point.way,4326)),
2000.0)
AND planet_osm_polygon.name = 'Erika-Hess-Eisstadion'
AND planet_osm_point.amenity = 'restaurant';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment