Skip to content

Instantly share code, notes, and snippets.

View az09's full-sized avatar
🔥
Working from everywhere

Anton Belichkov az09

🔥
Working from everywhere
View GitHub Profile
SELECT ST_AsBinary("geometry") AS geom,"bridge","render","stylegroup","tunnel","type" FROM ( SELECT geometry, type, 0 AS bridge, access, render, layer, 1 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_gauge', 'rail', 'tram') THEN 'railway'
ELSE 'other' END AS stylegroup
FROM (
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Standard Opening - open and read target input text file.
file = raw_input('Enter file name: ')
if len(file) < 1 : file = 'mbox-short.txt'
try :
fhand = open(file)
except :
print 'Cannot open file: ', file, '.', '...please try, again.'
exit ()
# Prime the dictionary