Skip to content

Instantly share code, notes, and snippets.

@ajashton
Created January 24, 2012 23:14
Show Gist options
  • Save ajashton/1673402 to your computer and use it in GitHub Desktop.
Save ajashton/1673402 to your computer and use it in GitHub Desktop.
Bridges from ImpOSM
( SELECT geometry, type, bridge, access, render, layer, 0 as tunnel,
CASE
WHEN type IN ('motorway', 'trunk') THEN 'motorway'
WHEN type IN ('primary', 'secondary') THEN 'mainroad'
WHEN type IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclassified', 'road', 'living_street') THEN 'minorroad'
WHEN type IN ('service', 'track') THEN 'service'
WHEN type IN ('path', 'cycleway', 'footway', 'pedestrian', 'steps', 'bridleway') THEN 'noauto'
WHEN type IN ('light_rail', 'subway', 'narrow_guage', 'rail', 'tram') THEN 'railway'
ELSE 'other' END AS stylegroup
FROM (
SELECT *, '1_outline' AS render FROM osm_roads WHERE bridge = 1
UNION
SELECT *, '2_line' AS render FROM osm_roads WHERE bridge = 1
UNION
SELECT *, '3_inline' AS render FROM osm_roads WHERE bridge = 1
) as bridges
ORDER BY layer ASC, render ASC
) AS data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment