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
4
votes
1 answer

Geopy Error with Reverse Geocoding

I am using Geopy. I get the following error for the code. I have using the same code as on https://code.google.com/p/geopy/wiki/ReverseGeocoding from geopy import geocoders g = geocoders.GeoNames() (place, point) = g.geocode("Palo Alto, CA…
Zero
  • 74,117
  • 18
  • 147
  • 154
3
votes
2 answers

How to get the distance between two geographic coordinates of two different dataframes?

I am working on a project for university, where I have two pandas dataframes: # Libraries import pandas as pd from geopy import distance # Dataframes df1 = pd.DataFrame({'id': [1,2,3], …
3
votes
3 answers

Python Geopy Nominatim too many requests

The following script works perfectly with a file containing 2 rows but when I tried 2500 row file, I got 429 exceptions. So, I increased the query time to 5 seconds. I also filled the user agent. After unsuccessful attempts, I connected to VPN to…
3
votes
2 answers

When calcuating distance between points on earth why are my Haversine vs. Geodesic calculations diverging?

I am getting wildly diverging distances using two approximations to calculate distance between points on Earth's surface. I am using the Haversine (vectorized) approximation and the more precise (presumably) geopy.distance.geodesic . As you can…
Bstampe
  • 689
  • 1
  • 6
  • 16
3
votes
2 answers

How to check that a point is inside the given radius?

I have the following code that takes very long time to execute. The pandas DataFrames df and df_plants are very small (less than 1Mb). I wonder if there is any way to optimise this code: import pandas as pd import geopy.distance import re def…
ScalaBoy
  • 3,254
  • 13
  • 46
  • 84
3
votes
1 answer

Longitude formatting/scale for calculating distance with geopy

I am using geopy to simply calculate the distance between two long,lat co-ordinates. However I am confused on what scale the longitude should be on. The latitude co-ordinated go from -90 to +90, and currently I've put my Longitude on a scale from…
Izzy888
  • 65
  • 2
  • 10
3
votes
1 answer

python geopy get city and country

I am trying to get city and country names with geopy. Normally this is how you can get city and country using geopy. from geopy.geocoders import Nominatim geolocator = Nominatim(timeout=3) geolocator.reverse('52.5094982,13.3765983') loc =…
alex
  • 2,381
  • 4
  • 23
  • 49
3
votes
2 answers

reverse geopy geocoding pandas

I have the following data frame in a Jupyter Notebook that has a list of GPS coordinates with from geopy.geocoders import Nominatim and import pandas as pd. stop_id Lat Long 0 2 53.352280 -6.263668 1 3 53.352345 …
DreamingMan
  • 73
  • 2
  • 7
3
votes
4 answers

Find the county for a city, state

I have a city + state information and I'm trying to find the county. I tried a few things. The closest I got is using geopy. Here is an example: from geopy.geocoders import Nominatim geolocator = Nominatim() loc = geolocator.geocode('Chicago…
Eyal S.
  • 1,141
  • 4
  • 17
  • 29
3
votes
0 answers

How do I use geopy (or a geopy-like framework) to access local OSM planet data?

Suppose I download data from OSM planet: https://planet.openstreetmap.org/ and would like to use geopy to make calls to my now local data rather than to the Nominatim framework. In other words, I would like to use OSM planet to implement a local…
anshad
  • 31
  • 3
3
votes
1 answer

How to find nearby points given a gps origin?

How does one find a nearby point given a gps coordinate? The new point can be randomly chosen, but must be within 100 meters of the origin. Collisions are fine as well. ie, origin = (latitude, longitude) # prints one nearby point in (lat,…
tempomax
  • 773
  • 4
  • 10
  • 24
3
votes
1 answer

Retrieving location accuracy with geopy

I have several thousand addresses to geocode at a time and am using geopy in a Django application to loop through a table which contains the addresses. I need fairly precise location coordinates and so "approximate" means an unsuccessful geocode for…
geoAndrew
  • 347
  • 1
  • 12
3
votes
1 answer

using geopy to find the country name from coordinates in a pandas dataframe

I am trying to determine the country name for each row in a pandas dataframe using geopy. What I have is: import pandas as pd from geopy.geocoders import GoogleV3 df = pd.DataFrame({'ser_no': [1, 1, 1, 2, 2, 2], 'lat': [53.57,…
dustin
  • 4,309
  • 12
  • 57
  • 79
3
votes
1 answer

Geopy error and timeout

I have been using geopy for a python project for about two months. I have maybe used the code under 100 times getting one return at a time. So I don't think that I am abusing it in away. Yesterday I was getting a timeout error and today I am getting…
jeffkrop
  • 147
  • 1
  • 1
  • 9
3
votes
0 answers

"ValueError: Must be a coordinate pair or Point" in python for lat and lon

The following code is from the package geopy for python (https://geopy.readthedocs.org/en/1.10.0/): from geopy.geocoders import Nominatim geolocator = Nominatim() location = geolocator.reverse("52.509669,…
RyanKilkelly
  • 279
  • 1
  • 4
  • 15