Last active
August 29, 2015 13:56
-
-
Save pnorman/9166688 to your computer and use it in GitHub Desktop.
address nodes near buildings of the same address but not inside
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
node,way addr:unit text polygon | |
node,way addr:housenumber text polygon | |
node,way addr:street text polygon | |
node,way addr:city text polygon | |
node,way building text polygon | |
node,way z_order int4 linear # This is calculated during import | |
way way_area real # This is calculated during import |
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
SELECT | |
poly.osm_id, node.osm_id, | |
poly."addr:street", | |
poly."addr:housenumber" | |
FROM planet_osm_polygon poly | |
JOIN planet_osm_point node ON (ST_DWithin(poly.way, node.way, 1000)) | |
WHERE poly.building IS NOT NULL | |
AND poly."addr:housenumber" = node."addr:housenumber" | |
AND poly."addr:street" = node."addr:street" | |
AND NOT ST_Intersects(poly.way, node.way); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment