Last active
August 29, 2015 14:24
-
-
Save darrell/7fe29b058cf87fd6f079 to your computer and use it in GitHub Desktop.
adjacent parcels with shared ownership
This file contains hidden or 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
-- if you want to add a buffer, only do so around | |
-- one geometry, so you can still take advantage | |
-- of indexes | |
SELECT DISTINCT a.* from | |
taxlots a | |
JOIN taxlots b | |
ON (a.owner1 in (b.owner1, b.owner2, b.owner3) | |
OR a.owner2 in (b.owner1, b.owner2, b.owner3) | |
OR a.owner3 in (b.owner1, b.owner2, b.owner3) | |
) | |
WHERE a.tlid<>b.tlid -- don't join to ourselves (which will always be true, and we'd just return the whole table) | |
AND st_intersects(a.the_geom,b.the_geom); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment