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

Swap values of column of lists that has nans

I have a data frame with columns: pd.DataFrame({'col':[[-74.61286283, 40.56889437], [nan, nan], [-105.18943020000002, 40.07872419], [-96.83537306, 32.82099448]]}) This column is a longitude-latitude column, but I want to make it…
RCN
  • 101
  • 10
1
vote
3 answers

Calculate distance between two coordinates for a fixed point in a DataFrame

I have the following DataFrame in pandas: code latitude longitude 01 40.410323 -3.993046 02 41.490604 1.696572 03 39.287817 -0.435448 04 38.594316 -0.128489 05 36.900799 -3.423063 06 36.541667 -4.625 I want to create a new…
Carola
  • 366
  • 4
  • 18
1
vote
0 answers

Return several matches from different countries using geopy geocoder

I have a zipcode, but I don't know the country reference. The zipcode could refer to Spain, France or Mexico (or other countries). from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="geoapiExercises") location =…
Carola
  • 366
  • 4
  • 18
1
vote
1 answer

How to gather points that can be directly connected with respect to buildings?

So I want to do something like this: Based on this sample I was able to draw OSM maps and add points based on this one. I wonder how to throw rays between points and see if they intersect with OSM buildings?
DuckQueen
  • 772
  • 10
  • 62
  • 134
1
vote
1 answer

Add rows from one dataframe to another based on distances between their geographic coordinates

I have a similar problem as here How to get the distance between two geographic coordinates of two different dataframes? Two dataframes: df1 = pd.DataFrame({'id': [1,2,3], 'lat':[-23.48, -22.94, -23.22], …
Julia Koncha
  • 85
  • 1
  • 12
1
vote
1 answer

How to handle response "None" from GeoPy client using Pandas apply?

I am working on pandas dataframe with quite a few hundreds addresses, trying to add a new column with coordinates received from geopy. Main question: how to handle unresolved geopy addresses, which gives result "None"? I am quite new in python and…
NoobVB
  • 989
  • 6
  • 10
1
vote
2 answers

Geopy distance between two point tuples of (lat, lon) coordinates

I've been trying to measure geographic distance between points in a GeoDataframe (gdb['geometry']) and one specific point, let's say, b_xy. gdb['geometry'] is a geodatabase containing tuples of lon/lat coordinates as such: geometry POINT…
1
vote
1 answer

Have street address, need geocoordinates using Python and geopy

I have a data set of street addresses and need to determine if they are within certain lat/long coordinates. Since I'm using Python, geopy seems like a common way to go. But geopy is not a geolocation service, it's "just a library which provides…
Chuck
  • 1,061
  • 1
  • 20
  • 45
1
vote
2 answers

Get New GPS with Known start GPS, bearing and distance in feet

I am brand new to Python in general and have a limited but aged knowledge of Javascript. I am trying to accomplish a small project using Python, but I have gotten stuck with my own comprehension. I have a GPS coordinate in decimal degrees as a…
DMSJax
  • 1,709
  • 4
  • 22
  • 35
1
vote
3 answers

How to create a column in Pandas with distance from coordinates using GeoPy

I have this df: latitude_1 longitude_1 0 -25.294871 -56.992654 1 -24.946374 -57.384543 2 -24.835273 -53.825342 3 -24.153553 -54.363844 And the following coordinates: coords_2 = (-25.236632, -56.835262) So I want to create a 3rd…
Hernan
  • 63
  • 3
  • 8
1
vote
1 answer

Slicing a list item that exists in a pandas dataframe

I have a list (named split_dfs) that contains several dataframes with 100 rows in each. These dataframes each contain columns with coordinate data that is stored in lists. i.e there is a column named Destination Coordinates and every row has data…
nesorethan
  • 95
  • 1
  • 6
1
vote
1 answer

Geopandas read geometry from geo_interface as JSON column in Dataframe

I have a GeoDataFrame with a geometry column (of polygons) and few other columns used for plotting polygons and their marker popups on the map. I exported this dataframe by using gdf.__geo_interface__ as a column geo and other attributes to a CSV…
S_S
  • 1,276
  • 4
  • 24
  • 47
1
vote
1 answer

Geocoder in python takes too much time to run

I'm trying to associate the city/country/state name to the latitude and longitude of my dataset. This is how I made it: import pandas as pd import io from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="geoapiExercises") def…
1
vote
2 answers

How can I read a CSV, add two more columns, and insert data that is dependent on the current columns?

I have a csv that looks like this but is much longer: ID Address 32 54298 Boca Chica Blvd Brownsville, TX 31 6640 Washington St, Yountville, CA 94599 I am attempting to loop through the csv, use geopy to get latitudes and longitudes…
1
vote
1 answer

Geopy Nominatim broke Heroku deploy

I deploy my telegram bot on Heroku and I use pyTelegramBotapi and geopy. The last time I deploy, it was 10 days ago, all was working fine but today when I starting command /geo I found that goopy Nominatim broken my function when it is on Heroku,…
navajo
  • 11
  • 1