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

Calculating distance between gps coordinates in columns

I am using geopy distance.distance function to calculate distance between each latitude and longitude points in a gpx file like this: lat lon alt time 0 44.565335 -123.312517 85.314 2020-09-07 14:00:01 1 44.565336 -123.312528 85.311 …
tbone
  • 7
  • 1
0
votes
0 answers

Can python's Dash be used to create a dashboard with input addresses and use geopy to output the corresponding longitude and latitude?

I wish to create a dashboard where a user can input a list of addresses separated by \n and then the dashboard will output a list of corresponding latitude and longitude values seperated by \n or as a pandas dataframe with two columns or original…
RMM
  • 313
  • 2
  • 11
0
votes
2 answers

how can I get country name by coordinates without external API?

What I am looking for? I am looking for a python library with a method/module that gets coordinates and return country name without connect to external API Why? I have a pandas df with a lot of rows (much more 10000) and I don't want to send a…
Dean Taler
  • 737
  • 1
  • 10
  • 25
0
votes
1 answer

Repeat process to dodge timeout problem in python

I am trying to create a function to loop through my list of regions and find Longitude and Latitude of them. But the problem is that I am experiencing a timeout problem, hence I want to prompt the system to sleep for about ten seconds and start…
user86907
  • 817
  • 9
  • 21
0
votes
1 answer

Custom field error from try/except in Django view?

I have a form for geocoding an address in my app. If a non-address is entered, the geocoder raises a "GQueryError". Using try/except I'd like to catch this error and send a custom error back to the form that would show up in the "errorlist" like the…
knuckfubuck
  • 969
  • 12
  • 25
0
votes
1 answer

Is there a Geopy Python function that converts dataframe column (Latitude/Longitude) from "degree minute second" to "degree decimal"

I applied the following function for each row in my dataframe (df), and using a Lat0/Lon0, direction(azimuth) and distance(dist) I got the new Lat/Lon in "degree minute second": def location(row): from geopy.distance import distance dist =…
0
votes
1 answer

Unbound local error does not occur consistently

I am trying to add data to my SQlite3 table which runs on a function that takes two arguments to find a city and a neighbourhood def scrapecafes(city, area) Strangely, this works well with some of the arguments I am entering but not with others. For…
deadant88
  • 920
  • 9
  • 24
0
votes
1 answer

How do I clean addresses so Nominatim can geolocate them properly?

I am trying to use Nominatim to geolocate sets of addresses I have scraped from the web. Nominatim works fine for "standard" addresses eg. 123 StreetName St., ExampleSuburb but some of the addresses I have scraped have "non-standard" elements eg.…
deadant88
  • 920
  • 9
  • 24
0
votes
1 answer

Unsure how to further optimise (get rid of for loop)

I am working on several datasets. One dataset (geodata - 74 observations) contains Indian district names, latitude and longitude of district centres while the other (called rainfall_2009) contains information on rainfall in a geographic grid as well…
Ted
  • 62
  • 7
0
votes
1 answer

Map a new column to a Pandas dataframe by comparing current and previous row of tuples

I am trying to map a new column to a pandas dataframe using a custom function that takes in two input tuples. The function is: def distance(origin, destination): lat1, lon1 = origin lat2, lon2 = destination radius = 3958.8 # miles dlat…
0
votes
1 answer

How can I include many coordinates on a map within a circle with Python?

I have a list of coordinates. Can I draw on map a circle that briefly covers them? I was thinking about using the folium package and drawing a circle centered at the average coordinates with radius of the distance to the farthest point. However, it…
Paw in Data
  • 1,262
  • 2
  • 14
  • 32
0
votes
1 answer

Finding the minimal distance between two coordinates from different lists

Sorry in advance, currently on mobile! So I basically have one list with around 50,000 lat/long tuples (list 1) and another one with around 1,800 lat/long tuples (list 2). What I want to do is the following: For each of the list elements in list 1,…
0
votes
0 answers

Force geopy to return multipolygon

Geopy's Geocoder wont return with a consistent object type. Depending on the search term, it may return a Polygon or a MultiPolygon. GeoDjango (Postgis) wont let me enter a Polygon in a Multipolygon field. Can I ask geopy to always return a…
Victor Ribeiro
  • 577
  • 7
  • 20
0
votes
0 answers

Tweepy function fetches 0 tweets for given geolocation

I am trying to get 50 tweets related to Coronavirus from all the states and union territories of India. The code is as below: import tweepy from tweepy import OAuthHandler from tweepy import API from tweepy import Cursor from time import…
Sarath
  • 163
  • 5
  • 14
0
votes
0 answers

Is there a way to install packages in a Jupyter notebook and not have to reload them every time I open the notebook?

I am working on a notebook and it involved geopy and folium. The packages take a while to install. Whenever I close my computer and open it back up again, I have to refresh the page to reconnect to the kernel (maybe that's a separate issue). After…
ajgoyak
  • 1
  • 1