Last active
December 17, 2015 02:39
-
-
Save lxbarth/5537879 to your computer and use it in GitHub Desktop.
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
# -*- coding: utf-8 -*- | |
# Translate DC building shapefiles with ogr2osm https://github.com/pnorman/ogr2osm | |
# | |
# Run: | |
# python ogr2osm/ogr2osm.py buildings.shp -t ogr2osm/translations/dcbuildings.py | |
# | |
# This will create a buildings.osm file ready to be opened, *reviewed* and uploaded with JOSM. | |
# | |
# This is preliminary code, not ready to be used for an import yet. | |
# | |
from pprint import pprint | |
def filterTags(attrs): | |
if not attrs: | |
return | |
tags = {} | |
tags['building'] = 'yes' | |
if 'ADDRNUM' in attrs: | |
tags['addr:housenumber'] = attrs['ADDRNUM'] | |
if 'STNAME' in attrs and 'STREET_TYP' in attrs and 'QUADRANT' in attrs: | |
tags['addr:street'] = '%s %s %s' % (attrs['STNAME'].lower(), attrs['STREET_TYP'].lower(), attrs['QUADRANT']) | |
if 'GIS_ID' in attrs: | |
tags['mappingdc:gid'] = attrs['GIS_ID'] | |
return tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment