]> git.openstreetmap.org Git - nominatim.git/commitdiff
adapt TIGER conversion script for python 3
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 28 Jul 2019 18:51:06 +0000 (20:51 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 28 Jul 2019 18:56:02 +0000 (20:56 +0200)
data-sources/us-tiger/README.md
data-sources/us-tiger/tiger_address_convert.py

index e75a9efa61386bdf011cd8158c6ed97c11062cfd..dfb44c5ff8f39478b394cee2f89f91d01c8e1ae2 100644 (file)
@@ -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 <input-path> <output-path>
-        
+
   4. Maybe: package the created files
-  
+
         tar -czf tiger2018-nominatim-preprocessed.tar.gz tiger
-        
\ No newline at end of file
index b1e2eb0cec8984813a2eacec1686d3a837b06af7..ebe265ed8ac4b832f58aadc1929251da319a510d 100755 (executable)
@@ -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: