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
votes
2 answers

AttributeError: 'NoneType' object has no attribute 'longitude'

I am trying to get coordinates for a 'city' column of a dataframe. That city column has a dtype of ('O'). Its a list of city names. I have made sure there are no digits or numbers within the city name. This is the function i run to get…
komskisp
  • 67
  • 1
  • 5
-1
votes
1 answer

speed up distance calculation in Python

How can I speed up the execution of this line: from geopy import distance ... df['Km'] = df.apply((lambda row: distance.distance(row['coord_1'],row['coord_2']).km),axis=1) where coord_1 and coord_2 are two large sets of…
erchugo
  • 31
  • 2
-1
votes
1 answer

how can i calculate the length of a car ride?

I have to calculate the length of a car ride (not the distance as the crow flies) between two addresses (e.g. "Milano, Piazza Duomo" and "Roma, Piazza Navona") in Python. How can I do this? I have read the documentation of geopy, but I have not…
-1
votes
1 answer

Is it possible to rotate an image layer on Openlayers?

I have a time-series point cloud which I wish to animate on Openlayers. The caveat is that the data is not georeferenced (ie, my x & y runs from 0-10km & 0-5km respectively) and the user will need to define the starting point(lonlat of where x&y=0)…
-1
votes
3 answers

Need to create option for km or mi using Tkinter and Python

So below I have a code that I found and modified for calculating the distance between two locations. I am creating a GUI for simple user input. Everything is working as expected but it would be a bonus if I could accomplish two things. Have a…
-1
votes
1 answer

Geopy Returns HTTP Error 400: Bad Request

I am using geopy package to get the location geocode but always run to the HTTP Error 400: Bad Request. Below is my code, which follows the official document https://geopy.readthedocs.io/en/stable/: from geopy.geocoders import ArcGIS geolocator =…
MAMS
  • 419
  • 1
  • 6
  • 17
-1
votes
1 answer

Calculate Distance for two locations between multiple points in 2 different files

import pandas as pd import numpy as np from geopy import distance #Import all the files shop_loc=pd.read_excel('locations.xlsx') comp_loc=pd.read_excel('locations_comp.xlsx') #convert the coordinates of both the files to a tuple list for the geopy…
-1
votes
1 answer

Geopy generate wrong coordinates (Lat and Lon)

When I try to look for London' Boroughs coordinates with GEOPY, some of the Boroughs are completely wrong (like Sutton appears in North London when is actually in the South). Also if the data frame where I am taking the information from is sorted by…
Sam
  • 1
  • 1
-1
votes
1 answer

deprecation warning:using nominatim with the default

webmap.py:5: DeprecationWarning: Using Nominatim with the default "geopy/1.22.0" `user_agent` is strongly discouraged, as it violates Nominatim's ToS https://operations.osmfoundation.org/policies/nominatim/ and may possibly cause 403 and 429 HTTP…
sankar
  • 1
  • 1
-1
votes
1 answer

Python - Calculating distances from two different list of long/lat

I have two data-frames with longitude and latitudes coordinates. df1 has 20 coordinates and df2 has 600 coordinates. What I am trying got do is to take each coordinate in df1 and find the closest coordinate in df. For example the first coordinate…
Slavisha84
  • 747
  • 3
  • 7
  • 22
-1
votes
1 answer

i have a few errors with building a python folium map

first of all please don't judge me but i am trying to build a folium map with markers of all the McDonalds places in my country. the first thing i did was downloading with webscraper all the nqmes and addresses of the places secondly i am trying to…
michox2
  • 113
  • 11
-1
votes
1 answer

Parsing a dictionary with raw address data given by geopy

I am trying to get the names of counties for a list of addresses. To do that, I am passing addresses to Google geocoding API using geopy and using raw method. The issue is parsing through the dictionary to get that chunk of data. I need the part…
user4718221
  • 561
  • 6
  • 20
-1
votes
1 answer

Distance between two Points in pandas csv Data-frame

I want to calculate the distance between two coordinates points(Lat1,long1, and Lat2,Long2) for the below data frame. `name_x rnc_x lat1 long1 scrambling_code name_y rnc_y lat2 long2 UI11481 MURNC09 72.82584 19.01234 121 UI11481…
DHANANJAY CHAUBEY
  • 107
  • 1
  • 2
  • 10
-1
votes
1 answer

Plotting a rectangular area on the surface of a sphere

I am trying to trace out a rectangular area on the surface of a sphere. This is the code I have for the sphere: import numpy as np import random as rand import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax…
-1
votes
1 answer

using geopy for finding a great circle distance

I have a dataframe with columns "start lat", "start lon", "end lat" and "end lon". I want to use geopy to calculate distance for each row using above four columns. Plz help. from geopy.distance import great_circle great_circle([df['start station…
user2958481
  • 587
  • 2
  • 8
  • 20
1 2 3
33
34