openvenues / lieu

Dedupe/batch geocode addresses and venues around the world with libpostal
MIT License
82 stars 23 forks source link

TypeError: 'NoneType' object is not iterable #8

Closed thisisaaronland closed 6 years ago

thisisaaronland commented 6 years ago

When running:

/usr/local/bin/dedupe_geojson --no-latlon -o . file1.geojson file2.geojson

Traceback (most recent call last):
  File "/usr/local/bin/dedupe_geojson", line 316, in <module>
    hashes = NameAddressDeduper.near_dupe_hashes(address, with_latlon=use_latlon, with_address=with_address, with_city_or_equivalent=use_city, with_small_containing_boundaries=use_containing, with_postal_code=use_postal_code, with_zip5=use_zip5, name_and_address_keys=with_address, name_only_keys=name_only)
  File "/usr/local/lib/python2.7/site-packages/lieu/dedupe.py", line 285, in near_dupe_hashes
    all_hashes.extend([h for h in hashes if h not in all_hashes_set])
TypeError: 'NoneType' object is not iterable
thisisaaronland commented 6 years ago

Oh, this might be because am I feeding it a FeatureCollection and not line-separated GeoJSON. One moment please...

thisisaaronland commented 6 years ago

My bad.

Eric-Arellano commented 6 years ago

I'm getting this error with the following input and running --no-latlon. Any ideas what might be happening, since this is a line-separated GeoJson file?

{"type":"Feature","properties":{"name":"Foursquare","addr:housenumber":"50","addr:street":"W 23 St","addr:unit":"Fl 8","addr:city": "New York","addr:state":"NY","addr:postcode":"10010"}}
{"type":"Feature","properties":{"name":"Foursquare","addr:housenumber":"50","addr:street":"W 23 St","addr:unit":"Fl 8","addr:city": "New York","addr:state":"NY","addr:postcode":"10010"}}

This also happens when the data source includes coordinates:

{"type":"Feature","geometry":{"type":"Point","coordinates":[40.742143, -73.991906]},"properties":{"name":"Foursquare","addr:housenumber":"50","addr:street":"W 23 St","addr:unit":"Fl 8","addr:city": "New York","addr:state":"NY","addr:postcode":"10010"}}
{"type":"Feature","geometry":{"type":"Point","coordinates":[40.742143, -73.991906]},"properties":{"name":"Foursquare","addr:housenumber":"50","addr:street":"W 23 St","addr:unit":"Fl 8","addr:city": "New York","addr:state":"NY","addr:postcode":"10010"}}

--

UPDATE: Never mind, it's because I wasn't passing the parameters "--use-city" etc, so it was trying to use LatLng and couldn't find that.

braco commented 5 years ago

These are maddeningly inscrutable error messages, how did you guys even figure out why it was throwing that?

Eric-Arellano commented 5 years ago

@braco pardon my delay in replying—I was traveling without wifi.

I remember debugging this by looking at the corresponding library source code and inserting import pdb; pdb.set_trace() in the site-packages code. This led to me finding that it was still trying to use LatLng, even though I passed --no-latlon, because I didn't also pass --use-city.

Do you still get the error when you pass --use-city?