Skip to content

Instantly share code, notes, and snippets.

Last active Dec 10, 2015
What would you like to do?
Maptime Seattle Postgis - Problem 4
SELECT, MIN(ST_Distance(p.geom, c.geom, true)) * 0.000621371 AS distance_miles
FROM transport.ports_ne p
CROSS JOIN geo.coastline_ne c
WHERE ST_Within(p.geom, (SELECT geom FROM geo.countries_ne WHERE admin = 'United States of America'))
ORDER BY distance_miles DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment