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

Geocoding non-addresses: Geopy

Using geopy to geocode alcohol outlets in NZ. The problem I have is that some places do not have street addresses but are places in Google Maps. For example, plugging: Furneaux Lodge, Endeavour Inlet, Queen Charlotte Sound, Marlborough 7250 into…
Phil Donovan
  • 1,075
  • 1
  • 9
  • 18
1
vote
1 answer

Equivalent of R geosphere::distGeo in Python

I am translating R code to Python. I can't find a function to match the output of R function geosphere::distGeo in Python. I have looked at a lot of answers here and it seems the Python equivalent is geopy.distance.geodesic, but the results don't…
gdevaux
  • 2,308
  • 2
  • 10
  • 19
1
vote
1 answer

Extract District from Coordinates Using Python

I have a collection of longitudes and latitudes, and I want to be able to extract the district of each of these coordinates using Python. As of right now, I have developed the following function using the geopy library, from geopy.geocoders import…
Minura Punchihewa
  • 1,498
  • 1
  • 12
  • 35
1
vote
2 answers

How do I find closest locations for each location in a list from a dataframe of unique locations

What I have is a list of city + state locations like this: import pandas as pd city_state = [ ['Austin, Texas', 30.264265060424805, -97.74750518798828], ['San Marcos, Texas', 29.882080, -97.939987], ['Denver, Colorado', 39.7392364,…
1
vote
0 answers

How to reverse geocode PySpark dataframe? I have VehicleID, eventdatetime, latitude, longitude, vehicle speed columns and over a million rows

I have VehicleID, eventdatetime, latitude, longitude, vehicle speed columns and over a million rows. I need to fetch city, state, district for the same. here is the working python code snippet for the same using geopy and reverse-geooder library. I…
1
vote
0 answers

GeocoderUnavailable: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain

I am currently trying to start working with geopy but I just can't get through a certification error: from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="autenticador") full_address = 'AVENIDA EDSON RAMALHO, 122, 58030100,…
1
vote
1 answer

Iterating through a dataframe to obtain location data from coordinates

I have a pandas dataframe that contains latitude and longitude and am trying to create a function to take the coordinates and determine what state each location is in. I am using geopy to obtain location information from the coordinates. Sample…
1
vote
1 answer

Organizing latitude and longitude into separate columns using Pandas and Geopy to geocode a list of addresses

I have set up a geocoding procedure in Python to determine the coordinates of a list of addresses in a csv file. I have it all set up and geocoding, however, I am struggling to figure out how to put the latitude and longitude into separate columns.…
1
vote
1 answer

Get address using Latitude and Longitude from two columns in DataFrame?

I have a dataframe with the longitude column and latitude column. When I try to get the address using geolocator.reverse() I get the error ValueError: Must be a coordinate pair or Point I can't for the life of me insert the lat and long into the…
1
vote
1 answer

Getting address with geopy takes too long

In the context of a project, I have hydrated 1.6 million tweets, i.e retrieved the metadata associated with the tweets such as date of creation, and location. My tweet dataset contains tweets from all over the world, however, I am only interested in…
lifrah
  • 13
  • 5
1
vote
0 answers

My geopy.geocoders is throwing error: SSL: CERTIFICATE_VERIFY_FAILED. How can I resolve this?

When I try to run this code. from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="ryan_data") location = geolocator.geocode("175 5th Avenue NYC") print(location.address) I get this error. GeocoderUnavailable:…
ASH
  • 20,759
  • 19
  • 87
  • 200
1
vote
1 answer

i want to calculate the distance using geodesic from geopy library

I have four lists of longitude and latitude ''' shop_long = [-123.223, -127.223, -123.223, -123.048] shop_lat = [49.1534, 55.1303, 49.1534, 53.2563] cus_long = [-126.07325247944962, -126.07255765553835, -126.07485428820583, …
1
vote
2 answers

Is there a way to output a dataframe containing latitude and longitude given City and Country in an excel file?

I have an excel file containing two columns. The first column is "City" and the second column is "Country". I want my python code to loop through each row and find the latitude and longitude for each row. The python code creates two new columns…
1
vote
1 answer

Return pandas column base on country short code with Geopy

I have a dataframe with about 100k rows and I would like to find the coordinates based on the country short code with geopy. The original dataframe look like this: index country city 0 CL SANTIAGO 1 BR SAO PAULO 2 BR ITUPEVA To limit…
Jay Cheng
  • 49
  • 4
1
vote
1 answer

Calculating the minimum haversine distance for a set of coordinates

I am trying to find an efficient way to calculate the distance to the nearest neighbour for a set of coordinates of form (lat, lon): [[51.51045038114607, -0.1393407528617875], [51.5084300350736, -0.1261805976142865], [51.37912856172232,…