0

I have already installed certificates (used this advice from a different thread) .Here's the code and the result

from geopy.geocoders import ArcGIS

nom = ArcGIS()
location=nom.geocode("3995 23rd st, San Francisco, CA 94114",timeout=180)
print(location)

What's the problem? I am not getting results for longitude/latitude. how to get the results?

Please help.

ElMuchacho
  • 300
  • 1
  • 12

1 Answers1

0

Using your code,

>>> print(location)  
3995 23rd St, San Francisco, California, 94114
>>> location
Location(3995 23rd St, San Francisco, California, 94114, (37.752990821253434, -122.43170235858965, 0.0))

The points are in there, but print() doesn't print them, just the address text string associated with them.

location is basically a dictionary of the results returned by the geocoding service.

>>> type(location)
<class 'geopy.location.Location'>
>>> location.latitude
37.752990821253434
>>> location.longitude
-122.43170235858965

here are the docs for the location class the results are stored in.

Hugh_Kelley
  • 988
  • 1
  • 9
  • 23