Questions tagged [geopy]

geopy allows you to convert between partial place names and latitude/longitude coordinates by wrapping many different online API's and providing access through one standard interface.

geopy allows you to convert between partial place names and latitude/longitude coordinates by wrapping many different online API's and providing access through one standard interface. Additionally, it contains convenience functions for parsing lat/long coordinates and finding as-the-crow-flies distance between them.

geopy makes it easy for developers to locate the coordinates of addresses, cities, countries, and landmarks across the globe using third-party geocoders and other data sources.

geopy includes support for many geocoders such as Google Maps, Bing Maps, Nominatim, and GeoNames.

504 questions
0
votes
1 answer

Returning a list of items that are raising an AttributeError when using geopy and try/except?

I am attempting to get the latitude and longitude for ~400 locations using geopy. However, many of the addresses are returning 'None' as they are either not specific enough or are intersections of streets, which is causing an "AttributeError: 'None'…
Martin
  • 51
  • 1
  • 3
  • 7
0
votes
1 answer

How do you limit the result of geolocator.geocode() in geopy?

How do you limit the result of geolocator.geocode() to a certain country only in geopy Python?
0
votes
0 answers

How do you set GeoPy to one specific country, in Python? i.e. The UK

Im having trouble setting GEOPY to one country specifically. For example, when I use GEOPY to give me the Long/Lat co-ordinates for Glagow, it returns Glasgow in USA! >>> print(location.address) Potsdamer Platz, Mitte, Berlin, 10117, Deutschland,…
Khan
  • 1
0
votes
1 answer

Python geopy accepts manual string but not when looping through csv df

not sure why this happening when i try to get location information. my sample csv has the following address,city,state,zip 767 5th Ave, New York, NY, 10153 and my python file looks like this, i included comments where i am having an issue from…
sn4ke
  • 587
  • 1
  • 14
  • 30
0
votes
1 answer

Pass Lat/Long to geolocator

New to python, I have a cvs file with lat/long and I am trying to retrieve the addresses, how can I pass my lat/long string to geolocator with open('try.csv', 'rb') as f: reader = csv.DictReader(f) for row in reader: geolat =…
lmundia
  • 11
  • 1
0
votes
1 answer

Packing and Unpacking Structs of GTiff files

I am working with an NDVI script that I did not write and I am trying to get it to run. The problem it's having is the old Type Error: Can't convert bytes object to str implicitly. I had never seen the struct package until yesterday, and after…
Chris
  • 89
  • 1
  • 2
  • 9
0
votes
1 answer

Plotting a Map with geopy and matplotlib in Jupyter Notebook

I am trying to plot a map of the US and mark the various cities across the country. I got the map to work. But I am having two issues: the first is, I am getting this error message: AttributeError: 'NoneType' object has no attribute…
Deepak M
  • 1,124
  • 2
  • 18
  • 28
0
votes
2 answers

Working out which points lat/lon coordinates are closest to

I currently have a list of coordinates [(52.14847612092221, 0.33689512047881015), (52.14847612092221, 0.33689512047881015), (52.95756796776235, 0.38027099942700493), (51.78723479900971, -1.4214854900618064) ...] I would like to split this list…
hsquared
  • 349
  • 2
  • 4
  • 17
0
votes
0 answers

python geopy returns NoneType object

I somehow can't iterate through the geolocator.reverse() function in geopy. It always runs into giving me NoneType objects. Single requests like this work perfectly fine: geolocator = Nominatim() location = geolocator.reverse("52.4286, 13.3556") plz…
fahrradlaus
  • 197
  • 1
  • 3
  • 13
0
votes
0 answers

Trying to build a Twitter heatmap in python

I am trying to teach myself Python. This might be a newbie question. This heatmap is one of the projects I've found and am trying to fix to try and learn. This is the code. It's one of three scripts involved with the project. I will post the other…
mpellas
  • 11
  • 1
0
votes
1 answer

Error appending to list according to state of bool

I am using 2 different libraries and running addresses through them. First i'm using geopy to clean and geocode addresses. Then i'm running the address through pygeocoder to see if the output is a valid address. If the output is valid, i'm appending…
Harrison
  • 5,095
  • 7
  • 40
  • 60
0
votes
1 answer

Convert a gps coordinate to an lat lng format?

This SO question has returned a coordinate like this: 48 52m 0.0s N, 2 21m 0.0s E. But I want it something like 37.783333, -122.416667. ie: import geopy import geopy.distance # Define starting point. start = geopy.Point(48.853, 2.349) # Define a…
tempomax
  • 773
  • 4
  • 10
  • 24
0
votes
0 answers

Python Geolocator Geocode location in None but still works + random string is added (weirdest error I ever saw)

I have at the moment to figure out where "favicon.ico" comes from. It is really super weird. I use geopy to geocode a location into latitude and longitude, then I use these values to create markers on a google map (Flask GoogleMaps). That is the…
Roman
  • 3,563
  • 5
  • 48
  • 104
0
votes
1 answer

Recursive loops with increasing size/arguments (Hamiltonian Paths?) Python

I have a code that takes n inputs and computes the shortest distance between them without ever revisiting the same point twice. I think this the same as the Hamiltonian Path problem. My code takes n addresses as inputs and iterates over all possible…
0
votes
1 answer

Implement multithreading (or multiprocessing?) with this script?

Let me first start this off by saying I don't have any real experience with multithreading. This script that I wrote reads ~4,400 addresses from a text file and then cleans the address and geocodes it. My brother mentioned something about using…
Harrison
  • 5,095
  • 7
  • 40
  • 60