Skip to content

Instantly share code, notes, and snippets.

@joshuapowell
Last active August 29, 2015 14:23
Show Gist options
  • Save joshuapowell/960611516647012fceb3 to your computer and use it in GitHub Desktop.
Save joshuapowell/960611516647012fceb3 to your computer and use it in GitHub Desktop.
Associate Report with HUC in WaterReporter
SELECT
r.id AS report_id,
t.id AS territory_id,
t.huc_12_name,
t.huc_10_name,
t.huc_8_name,
t.huc_6_name
FROM
territory t,
report r
WHERE
ST_Intersects(r.geometry, t.geometry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment