From: Sarah Hoffmann Date: Sun, 28 Jul 2019 18:51:06 +0000 (+0200) Subject: adapt TIGER conversion script for python 3 X-Git-Tag: v3.4.0~16^2 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/46e077c40bf26eb92009fb04ff6f7dae92272e46?hp=7753ba6019ec873bf27b0a01fe9e5bfc65169740 adapt TIGER conversion script for python 3 --- diff --git a/data-sources/us-tiger/README.md b/data-sources/us-tiger/README.md index e75a9efa..dfb44c5f 100644 --- a/data-sources/us-tiger/README.md +++ b/data-sources/us-tiger/README.md @@ -9,9 +9,7 @@ Replace '2018' with the current year throughout. 1. Install the GDAL library and python bindings and the unzip tool # Ubuntu: - sudo apt-get install python-gdal unzip - # CentOS: - sudo yum install gdal-python unzip + sudo apt-get install python3-gdal unzip 2. Get the TIGER 2018 data. You will need the EDGES files (3,233 zip files, 11GB total). @@ -22,8 +20,7 @@ Replace '2018' with the current year throughout. cd data-sources/us-tiger ./convert.sh - + 4. Maybe: package the created files - + tar -czf tiger2018-nominatim-preprocessed.tar.gz tiger - \ No newline at end of file diff --git a/data-sources/us-tiger/tiger_address_convert.py b/data-sources/us-tiger/tiger_address_convert.py index b1e2eb0c..ebe265ed 100755 --- a/data-sources/us-tiger/tiger_address_convert.py +++ b/data-sources/us-tiger/tiger_address_convert.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Tiger road data to OSM conversion script # Creates Karlsruhe-style address ways beside the main way # based on the Massachusetts GIS script by christopher schmidt @@ -164,7 +164,7 @@ def parse_shp_for_geom_and_tags( filename ): if (statefp != None) and (countyfp != None): county_name = county_fips_data.get(statefp + '' + countyfp) if county_name: - tags["tiger:county"] = county_name.encode("utf-8") + tags["tiger:county"] = county_name # tlid = poFeature.GetField("TLID") # if tlid != None: