Skip to content

Instantly share code, notes, and snippets.

@parkercoleman
Created December 9, 2015 23:45
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/fd581490f66f10998a11 to your computer and use it in GitHub Desktop.
Save parkercoleman/fd581490f66f10998a11 to your computer and use it in GitHub Desktop.
Maptime Seattle Postgis - Problem 3
WITH states_with_railroads AS (
SELECT DISTINCT s.name
FROM geo.states_ne s
INNER JOIN geo.railroads_ne r ON ST_Intersects(s.geom, r.geom)
WHERE admin='United States of America'
)
SELECT DISTINCT s.name
FROM geo.states_ne s
WHERE admin='United States of America'
AND s.name NOT IN (SELECT * FROM states_with_railroads)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment