thampiman / reverse-geocoder

A fast, offline reverse geocoder in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hello World Error

mooreed opened this issue · comments

commented

After performing a "pip install"

Open the python REPL and copy paste in the example in the README.md

import reverse_geocoder as rg
coords = (32.774185,-96.800618)
results = rg.search(coords)
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/reverse_geocoder/init.py", line 194, in search
return rg.query(geodetic_in_ecef(geo_coords))
File "/Library/Python/2.7/site-packages/reverse_geocoder/init.py", line 174, in geodetic_in_ecef
lat = geo_coords[:,0]
IndexError: too many indices

Hi Eric -- That is most certainly a bug. In the current version, the search function expects a list of coordinates. If you're only querying for a single coordinate, you can use the get function instead. Something like this...

coord = (32.774185,-96.800618)
result = rg.get(coord)

In the meantime, I'll fix the search function. Thanks!