]> git.openstreetmap.org Git - nominatim.git/commitdiff
tiger import: convert counties to str
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 23 Oct 2017 19:24:11 +0000 (21:24 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 24 Oct 2017 20:27:09 +0000 (22:27 +0200)
For python2 the gdal features come out as str and
cannot be combined with unicode strings.

utils/tigerAddressImport.py

index c0d83cebf876d43eccb5bb46fe29653185d0d126..0dc55e99e9bc38af0789aaa2faed85cd3a630ae2 100755 (executable)
@@ -161,9 +161,9 @@ def parse_shp_for_geom_and_tags( filename ):
         statefp = poFeature.GetField("STATEFP")
         countyfp = poFeature.GetField("COUNTYFP")
         if (statefp != None) and (countyfp != None):
-            county_name = county_fips_data[statefp + '' + countyfp]
+            county_name = county_fips_data.get(statefp + '' + countyfp)
             if county_name:
-                tags["tiger:county"] = county_name
+                tags["tiger:county"] = county_name.encode("utf-8")
 
         # tlid = poFeature.GetField("TLID")
         # if tlid != None: