OpenCageData / python-opencage-geocoder

Python module to access the OpenCage geocoding API
https://opencagedata.com/tutorials/geocode-in-python
Other
78 stars 22 forks source link

NameError: global name 'query_for_reverse_geocoding' is not defined #3

Closed borbash closed 10 years ago

borbash commented 10 years ago

I get the error when I attempt a simple reverse geocode:

...from my geocode1.py:

import sys from opencage.geocoder import OpenCageGeocode

key = '...' geocoder = OpenCageGeocode(key)

lat = sys.argv[1] lng = sys.argv[2] result2 = geocoder.reverse_geocode(lat, lng) print(result2) ...

Then when I run: $ ./geocode1.py 39.26 -76.6739 Traceback (most recent call last): File "./geocode1.py", line 22, in result2 = geocoder.reverse_geocode(lat, lng) File "/Library/Python/2.7/site-packages/opencage-1.0.0-py2.7.egg/opencage/geocoder.py", line 147, in reverse_geocode return self.geocode(query_for_reverse_geocoding(lat, lng)) NameError: global name 'query_for_reverse_geocoding' is not defined

borbash commented 10 years ago

(By the way, there was no such problem with (forward) geocoding. The problem only occurs with reverse geocoding.)

freyfogle commented 10 years ago

Hi @borbash, many thanks for testing and giving us the feedback. Should be fixed thanks to @darksmo's quick work. Please let us know.

borbash commented 10 years ago

Works! Thanks for the quick response.