-
-
Save oeon/1263089 to your computer and use it in GitHub Desktop.
San Luis Obispo translation file (ogr2osm)
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
def translateAttributes(attrs): | |
if not attrs: | |
return | |
tags = {} | |
if int(attrs['SPD_PST']) > 0: | |
tags.update({'maxspeed':attrs['SPD_PST'] + ' mph'}) | |
if attrs['FULLNAME']: | |
tags.update({'name:fullname':attrs['FULLNAME'],'source:maxspeed':'sign' }) | |
if attrs['ONE_WAY'] in ('FT', 'TF'): | |
tags.update({'oneway':'yes'}) | |
else: | |
tags.update({'oneway':'no'}) | |
if attrs['CATEGORY'] == 'ROAD': | |
tags.update({'highway':'residential'}) | |
elif attrs['CATEGORY'] in ('ALLEY', 'CAMPGROUND', 'MOBILE HOME PARK', 'PARK ROAD', 'PIER'): | |
tags.update({'highway':'service'}) | |
elif attrs['CATEGORY'] == 'DRIVEWAY': | |
tags.update({'highway':'service','service':'driveway'}) | |
elif attrs['CATEGORY'] == 'FREEWAY': | |
tags.update({'highway':'motorway'}) | |
elif attrs['CATEGORY'] == 'HIGHWAY': | |
tags.update({'highway':'primary'}) | |
elif attrs['CATEGORY'] == 'RAMP': | |
tags.update({'highway':'motorway_link'}) | |
elif attrs['CATEGORY'] == 'TRAIL': | |
tags.update({'highway':'path'}) | |
elif attrs['CATEGORY'] == 'CEMETERY': | |
tags.update({'highway':'service'}) | |
if attrs['PAVED'] == 'YES': | |
tags.update({'surface':'paved'}) | |
elif attrs['PAVED'] == 'NO': | |
tags.update({'surface':'unpaved'}) | |
return tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment