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
1
vote
1 answer

Pandas dataframe : Applying function to row value and value from the previous row

I am trying to apply the following function to a Pandas dataframe: def eukarney(lat1, lon1, alt1, lat2, lon2, alt2): p1 = (lat1, lon1) p2 = (lat2, lon2) karney = distance.distance(p1, p2).m return np.sqrt(karney**2 + (alt2 -…
mirix
  • 511
  • 1
  • 5
  • 13
1
vote
0 answers

Google Map API deny request

I want to convert a list of addresses to geocoordinates. I'm using GeoPy with Google Map API but it doesn't work. My code is import geopy from geopy.geocoders import GoogleV3 geocoder =…
Son Pham
  • 25
  • 5
1
vote
1 answer

Getting SSL Error on AWS EC2 Instance When I Try to Reach GeoPy API

I'm trying to connect to the Nominatim GeoPy API to resolve latitude/longitude coordinates from zip codes. The implementation looks as follows (minimum reproducible): # Create a function that returns lat/lon coordinates from zip code def…
Zach Rieck
  • 419
  • 1
  • 4
  • 23
1
vote
0 answers

AttributeError: 'RequestsHTTPWithSSLContextAdapter' object has no attribute '_RequestsHTTPWithSSLContextAdapter__ssl_context'

I am performing reverse geocoding i.e converting coordinates to city by using geopy's Nominatim locator in pyspark. I packed it inside a function getCity() which takes a pair of coords in string and returns the city. For example: from…
1
vote
1 answer

I want to calculate overlap area from semicircle draw in map using python

I'm trying calculate overlap area created by semicircle which created by folium.after that i want to assign x,y,z value to the each semi semicircle by reduce same value overlap ex:- to reduce two x value semicircles here is the image for better…
1
vote
1 answer

Python: geopy.distance.geodesic in a for loop

I have the following data and I am trying to compute the geopy distance from one observation to another using their latitudes and longitudes. trip3 >> trip_id latitude longitude 0 …
Joehat
  • 979
  • 1
  • 9
  • 36
1
vote
0 answers

Python pip install geopy on MAC OSX, alter Error : geopy-2.1.0-py3-none-any.whl is not a supported wheel on this platform

pip install ~/Downloads/geopy-2.1.0-py3-none-any.whl pip install geopy DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of…
StriveZs
  • 11
  • 1
1
vote
2 answers

Changing the geodesic datatype to an integer

With this code, I want to create a distance matrix, which works! I have used the geopy package and use the geodesic distance method to calculate the distance between coordinates that are stored in a Pandas dataframe. def get_distance(col): end =…
Lonneke
  • 11
  • 3
1
vote
1 answer

How to get latitude and latitude for an address column in a dataframe using geopy?

I am currently working on a kaggle dataset House price prediction It has errors in the latitude and latitude column, so I decided to use geopy to get right values for those two columns. And it works fine if I use it on one single address but returns…
1
vote
1 answer

How to write multiple rows in column excel python?

I have 'column A' contains Hotel Name, i want to write 'loc.address' for each hotel at 'column B' in excel ex: i use this code: import pandas as pd from geopy.geocoders import Nominatim import xlrd # Give the location of the file loc =…
Abdullah Md
  • 151
  • 15
1
vote
0 answers

python django latitude longitude filter in queryset

I have a field like class MyModel(models.Model): latitude = models.CharField(max_length=100, db_index=True) longitude = models.CharField(max_length=100, db_index=True) Lets say I have lat long value like myval = (27.66469717424158,…
rudra
  • 61
  • 4
1
vote
1 answer

KeyError Traceback (most recent call last)

**from geopy.geocoders import Here exif = get_exif('earth_postcard_1599147372.jpg') geotags = get_geotagging(exif) coords = get_coordinates(geotags) geocoder = Here(apikey=os.environ['API_KEY']) print(geocoder.reverse("%s,%s" %…
Dhanush R
  • 11
  • 1
  • 2
1
vote
0 answers

Max Retries Exceeded and SSL Errors

I'm looking for some assistance in resolving this error. geopy.exc.GeocoderUnavailable: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?q=ADDRESS&format=json&limit=1 (Caused by…
Jessica
  • 11
  • 2
1
vote
1 answer

Pandas function .apply() not passing arguments "ValueError: Point coordinates must be finite. (nan, nan, 0.0) has been passed as coordinates."

Python Masters I'm trying to speed up my code with pandas .apply() function. However, I'm facing a problem that I don't understand how to solve. The main goal of the script is to loop over DataFrame and determine a distance between 2 points on a…
1
vote
2 answers

How do I get zipcodes from longitude and latitude on python?

I have a data frame of latitude and longitude coordinates on this CSV file:Longlat. I used this code to try to get the zipcodes: import copy def get_zipcode(df, geolocator, lat_field, lon_field): location = geolocator.reverse((df[lat_field],…
BridgeSmith
  • 35
  • 1
  • 5