From: Sarah Hoffmann Date: Mon, 23 Oct 2017 19:24:11 +0000 (+0200) Subject: tiger import: convert counties to str X-Git-Tag: v3.1.0~35 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/9ac401267a6e28eb3cf6b1f73188321213e398c1?ds=sidebyside;hp=a71200a57a2417e0c5dfba4fe42ecdb371da3dba tiger import: convert counties to str For python2 the gdal features come out as str and cannot be combined with unicode strings. --- diff --git a/utils/tigerAddressImport.py b/utils/tigerAddressImport.py index c0d83ceb..0dc55e99 100755 --- a/utils/tigerAddressImport.py +++ b/utils/tigerAddressImport.py @@ -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: