Skip to content

Instantly share code, notes, and snippets.

@aaronlidman
Created June 7, 2012 16:26
Show Gist options
  • Save aaronlidman/2889878 to your computer and use it in GitHub Desktop.
Save aaronlidman/2889878 to your computer and use it in GitHub Desktop.
z10
(SELECT way, highway, railway,
(CASE WHEN highway IN ('motorway') THEN 'highway'
WHEN highway IN ('trunk', 'primary') THEN 'major_road'
ELSE 'minor_road' END) AS kind,
'no'::VARCHAR AS is_link,
(CASE WHEN tunnel IN ('yes', 'true') THEN 'yes'
ELSE 'no' END) AS is_tunnel,
(CASE WHEN bridge IN ('yes', 'true') THEN 'yes'
ELSE 'no' END) AS is_bridge,
(CASE WHEN highway IN ('motorway') THEN 0
WHEN highway IN ('trunk', 'primary') THEN 1
WHEN highway IN ('secondary', 'tertiary') THEN 2
ELSE 99 END) AS priority
FROM planet_osm_line
WHERE highway IN ('motorway')
OR highway IN ('trunk', 'primary')
OR highway IN ('secondary')) as roads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment