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

how to ignore AttributeError: 'NoneType'

location = geolocator.geocode(" ".join(address.values())) if location.longitude is not None: node['pos'] = [location.longitude, location.latitude] Don't understand way I'm still getting this error: File…
Donnie Z
  • 41
  • 1
  • 2
  • 4
3
votes
2 answers

Geopy too slow - timeout all the time

I am using geopy to get latitude - longitude pairs for city names. For single queries, this works fine. What I try to do now is iterating through a big list of city names (46.000) and getting geocodes for each city. Afterwards, I run them through a…
Tobias Petri
  • 31
  • 1
  • 3
3
votes
2 answers

Timeout error in Python geopy geocoder

I am a relatively new Python user and am attempting to use a function to return the latitude and longitude for a city and country using the "geopy" module. I have had errors because my city was misspelled which I have managed to catch. The trouble I…
pitts_brother
  • 31
  • 1
  • 1
  • 2
3
votes
0 answers

Service timed out using geocoders API in Geopy

I found this code online but it is not working for me: from geopy import geocoders g = geocoders.GeoNames(username="myusersname") (place, point) = g.geocode("Palo Alto, CA 94306") print place print point (new_place,new_point)…
3
votes
3 answers

Google geocoding: points of interest within a specified radius

After searching around it appears that many people already have the lat/long data of the geographic points of interest they are interested in reverse-geocoding. In my scenario I know a starting location and would like to find all points of interest…
RobertJoseph
  • 7,968
  • 12
  • 68
  • 113
3
votes
1 answer

Python sum lat/lon points within geographic radius and sum to grid

Basically, my experimental program is trying to find the number of points that fall within a (e.g., 50km) radius of a valid point at a given time. My data is structured (but I can restructure if need-be) in three separate arrays…
wuffwuff
  • 730
  • 2
  • 9
  • 19
3
votes
1 answer

GPS positioning with Python, geopy, shapely

I'm trying to work on the following scenario: Getting polygon coordinates from google earth Getting boundaries with Shapely: >>> polygon =…
user1790755
  • 31
  • 1
  • 3
2
votes
2 answers

Parse DataFrame of postal addresses - remove country and unit number

I have a dataframe with a column of postal addresses (generated with geopy.geocoders GoogleV3 - I used it to parse my dataframe). The output of geolocator.geocode, however, has the country name - which I don't want. It also contains Unit number -…
Saania
  • 623
  • 5
  • 6
2
votes
1 answer

Geopandas gets creative when it can't find the street

I have noticed an interesting behavior when when working with Geopandas. When Geopandas is fed a street that it presumably cannot find, it will somehow substitute an existing street that seems to be near the city of the address. See below…
neanderslob
  • 2,633
  • 6
  • 40
  • 82
2
votes
1 answer

disabling tls certificate checking not working

I'm having issues in android (kivy) about ssl verification: 02-12 18:19:15.622 5082 5116 I python : geopy.exc.GeocoderUnavailable: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url:…
magowiz
  • 59
  • 5
2
votes
1 answer

Why do the Pyproj and Haversine methods to calculate heading from two lat/lon points differ from what Google Earth displays?

I am trying to implement a short python function to calculate the heading between two points. In other words if I am at point one, what heading relative to true north would I need to take to get to point two. I have used the following Python…
Jon
  • 1,621
  • 5
  • 23
  • 46
2
votes
1 answer

ModuleNotFoundError while using geodesic in udf pyspark function

We have pyspark dataframe like: df = spark.createDataFrame([(['target'], [2], [2], [3], [3]), (['NJ'],[3],[3], [4], [4]), (['target', 'target'],[4,5], [4,5], [6,7], [6,7]), (['CA'],[5],[5], [6], [6]), ], ('group_name', 'long',…
maketew
  • 31
  • 2
2
votes
1 answer

How to find distance from base coordinate points in a dataframe?

I have a dataframe that looks like this: lat lon time 45.23 81.3459 2021-04-25 12:31:15 45.265 81.346 2021-04-25 12:33:46 45.278 81.347 2021-04-25 12:40:23 ....... ......... .................... I have thousands of rows in the…
2
votes
1 answer

Calculate the geographical distance in pyspark dataframe

My dataframe: DF = spark.createDataFrame([[114.038696, 22.5315, 114.047302, 22.531799], [ 114.027901, 22.5228, 114.026299, 22.5238], [ 114.026299, 22.5238,114.024597,22.5271], [114.024597, 22.5271,114.024696,22.527201]],…
2
votes
2 answers

Python generate lat/long points from address

How do I take addresses and generate lat, long coordinates from them in python? I have a few addresses that I would like get lat, long points but seems it doesn't work. I used geopandas but it returns me nothing. I am also a bit confused about what…
Tahsin Alam
  • 147
  • 1
  • 10