Skip to content

Instantly share code, notes, and snippets.

@parkercoleman
Created December 9, 2015 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parkercoleman/cfdbae09c11e4ff85e4a to your computer and use it in GitHub Desktop.
Save parkercoleman/cfdbae09c11e4ff85e4a to your computer and use it in GitHub Desktop.
Maptime Seattle Postgis - Problem 2
SELECT a.name, ST_Distance(c.geom, a.geom, true) * 0.000621371 AS distance_as_miles
FROM geo.cities_ne c
CROSS JOIN transport.airports_ne a
WHERE c.name = 'Seattle'
ORDER BY ST_Distance(c.geom, a.geom, true) ASC
LIMIT 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment