Created
July 28, 2016 12:33
-
-
Save das-g/ce273b3f57b6442b65405abd0c033141 to your computer and use it in GitHub Desktop.
Query to combine OSMaxx roads and railways (suitable as QGIS virtual layer query)
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
SELECT | |
"osm_id", "lastchange", "geomtype", geometry, "type", "name", "label", "tags", | |
'highway' as "super_type", | |
"aggtype", | |
"bridge", | |
NULL as "frequency", | |
"oneway", | |
"ref", | |
'operational' as "status", | |
"tunnel", | |
NULL as "voltage", | |
"z_order" | |
FROM road_l | |
UNION | |
SELECT | |
"osm_id", "lastchange", "geomtype", geometry, "type", "name", "label", "tags", | |
'railway' as "super_type", | |
"aggtype", | |
"bridge", | |
"frequency", | |
NULL as "oneway", | |
NULL as "ref", | |
'operational' as "status", | |
"tunnel", | |
"voltage", | |
"z_order" | |
FROM railway_l | |
UNION | |
SELECT | |
"osm_id", "lastchange", "geomtype", geometry, "sub_type" as "type", "name", "label", "tags", | |
"type" as "super_type", | |
NULL as "aggtype", | |
NULL as "bridge", | |
NULL as "frequency", | |
NULL as "oneway", | |
"ref", | |
"status", | |
NULL as "tunnel", | |
NULL as "voltage", | |
"z_order" | |
FROM nonop_l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment