Created
August 9, 2015 16:58
-
-
Save giacecco/d8faae19c59b30b8a5ab to your computer and use it in GitHub Desktop.
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
DROP VIEW IF EXISTS os_open_names_with_towns; | |
CREATE VIEW os_open_names_with_towns AS | |
SELECT a.*, b.town AS lr_town | |
FROM | |
(SELECT * FROM os_open_names WHERE type = 'transportNetwork') AS a, | |
(SELECT town, bounding_box FROM lr_pp_town_definition) AS b | |
WHERE ST_Contains(b.bounding_box, a.mbr) | |
UNION | |
SELECT *, NULL AS lr_town FROM os_open_names WHERE type != 'transportNetwork'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment