Created
January 12, 2020 17:28
-
-
Save oeon/461cfb8d7c6bcb4cc59aec79bdf29865 to your computer and use it in GitHub Desktop.
where ESA is a polygon layer. Use PostGIS to test in/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- inside ESA | |
UPDATE htmp points SET esa = 'yes' | |
FROM | |
(SELECT DISTINCT(poi.*) | |
FROM vm_esa pol | |
JOIN htmp poi | |
ON (ST_Within(poi.geom, pol.geom))) inside | |
WHERE points.legacy_fulcrum_id = inside.legacy_fulcrum_id; | |
-- outside ESA | |
UPDATE htmp points SET esa = 'no' | |
FROM | |
(SELECT DISTINCT(htmp.*) | |
FROM htmp | |
LEFT JOIN vm_esa | |
ON ST_Intersects(htmp.geom, vm_esa.geom) | |
WHERE vm_esa.id IS NULL) outside | |
WHERE points.legacy_fulcrum_id = outside.legacy_fulcrum_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment