Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Maptime Seattle Postgis - Problem 4
SELECT p.name, 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'))
GROUP BY p.name
ORDER BY distance_miles DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment