# Tag Info

Accepted

### Shapely Distance different from Geopy/Haversine

Because the principles and the algorithms are different (look at Geographical distance) Shapely use the euclidean distance in a cartesian plane and the shortest distance between two points in a plane ...
Accepted

### Avoid time out error Nominatim Geopy OpenStreetMap

You could make a recursive function. Just typing Python-esque pseudo-code: from geopy.exc import GeocoderTimedOut def do_geocode(address, attempt=1, max_attempts=5): try: return geopy....
Accepted

### User_Agent argument in Nominatim in GeoPy

User_Agent is an http request header that is sent with each request. Nominatim requires this value to be set to your application name. The goal is to be able to limit the number of requests per ...
Accepted

### Bulk reverse geocoding with Geopy using built-in rate_limiter

The correct usage of RateLimiter for reverse geocoding would be: from geopy.geocoders import Nominatim from geopy.extra.rate_limiter import RateLimiter geolocator = Nominatim(user_agent="application"...
Accepted

### inaccurate distance measurements in Python

If you inverse the coordinates, it does not work (geopy uses (latitude,longitude) in the WGS84 crs) dublin = (53.33306,-6.24889) liverpool = ( 53.41058,-2.97794) print distance(dublin, liverpool)....
Accepted

### Difference in destination location between pyproj and geopy

It looks like you've done everything correctly. You can evaluate the errors from each method by performing the inverse calculations to find the distance given the origin and destination coordinates, ...

### Difference between Vincenty and great-circle distance calculations?

My apologies for posting a second answer here, but I taking the opportunity to respond to the request by @craig-hicks to provide accuracy and timing comparisons for various algorithms for computing ...
Accepted

### Get lat-long of US cities and plot them on a map using matplotlib and basemap

I was able to use the API to put together the program I wanted. Here it is: # Draw the locations of cities on a map of the US import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap ...

### Plot a circle with a given radius around points on map using Python

What you want: Create a circle from the center of each marker This can be easily solved with geopandas buffer functions. You can see the description here. #make circle from point new_df = geo_df.copy()...
Accepted

### Python function to get the co-ordinate pair of a point

The geolocator.reverse() method is expecting a Point obejct or a tuple with two coordinates. However, you are passing redshape, which is a fiona.collection.Collection object with all the features in ...
Accepted

### Get state but want country in GeoPy and Nominatim

When you try embedding exactly_one=False parameter (by default it is True) into your code, like from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent='anonymous@gmail.com', timeout=...
Accepted

### Having difficulty retrieving city and area names using Geopy (Google V3)

Be careful with your variable names. You're dangerously re-defining the variable c within your list comprehensions. Do this instead: counties = [x['long_name'] for x in c if 'neighborhood' in x['...

### What kind of margin of error can I expect in figuring distance?

Pre-Answers The word accuracy carries different meanings in Survey Engineering and in GIS even though both are related. In the former, it is explained here. In the latter, it was discussed here. ...
Accepted

### Extracting GPS points inside the region boundary

Use within: Returns a Series of dtype('bool') with value True for each geometry that is within other. from shapely import geometry import geopandas as gpd import pandas as pd file = r'C:\folder\...
Accepted

### differences in distance between shapely and geopy

1) For calculate the Vincenty distance, you need coordinates in longitude, latitude (degrees) and you choose WGS84 (look at with Geopy:distance) 2) The coordinates of your points are in meters: u'...

### Difference in destination location between pyproj and geopy

The geopy pull request fixes your issue with geopy. You will need to install the python package geographiclib first with pip install geographiclib

### Shapely Distance different from Geopy/Haversine

And here's another distance calculation from GeographicLib: from geographiclib.geodesic import Geodesic g = Geodesic.WGS84.Inverse(39.435307, -76.799614, 39.43604, -76.79989) print(g['s12']) # 84....

### Reverse geocoding of Pandas DataFrame with Lat/Long columns

A solution: from geopy.geocoders import Nominatim locator = Nominatim(user_agent="myGeocoder") print(test) id Latitude Longitude 0 1 30.197535 -97.662015 1 2 34.895699 -82....
Accepted

### Reverse geocoding of Pandas DataFrame with Lat/Long columns

Here the Nominatim geocoder (free to choose) from the GeoPy geocoding Python library was used, for more details, please check the documentation. Coordinates of point features should be passed as a ...

### ValueError: Columns must be same length as key

pandas is expecting two values (columns) to be returned as you specified two keys ['Latitude', 'Longitude']. However, when there's an exception, e.g. no geocoding result, you only return a single ...

### Difference between Vincenty and great-circle distance calculations?

Whether using vincenty or haversine or the spherical law of cosines, there is wisdom in becoming aware of any potential issues with the code you are planning to use, things to watch out for and ...

### Difference between Vincenty and great-circle distance calculations?

It appears that the geopy.distance package offers a function "distance()" which defaults to vincenty(). I would recommend using distance() on principle, as it is the package recommendation, in case ...

### Get lat-long of US cities and plot them on a map using matplotlib and basemap

With Python, you could use the geopy module: >>> from geopy.geocoders import Nominatim >>> geolocator = Nominatim() >>> loc = geolocator.geocode("New York, NY") >>>...
Accepted

### When calcuating distance between points on Earth why are my Haversine vs. Geodesic calculations wildy diverging?

I appreciate your code because it contributes to geodesy, by allowing to make some interesting analyzes in a practical way, regarding spherical approximations for the calculation of length of geodesic ...

### When calcuating distance between points on Earth why are my Haversine vs. Geodesic calculations wildy diverging?

There was a matrix algebra error in the Haversine formula. I updated the code in the question. I am getting much better agreement between Haversine and geodesic now: On my actual dataset:
Accepted

### Getting output in different language in GeoPy

As per the doc, you can specify the language as a str type in the parameters of the reverse() method. By default it is language=False, that matches the language of the country for which the geocoder ...

### Making ellipse geometry from some known parameters using PostGIS?

I would go with CIRCULARSTRING. You already know the coordinates of start point and end point, and the coordinates for the peak radius can be easily calculated. Thus, the half of your desired ...
Accepted

### Python: Trying to figure out Geopy in python for reverse look ups

Don't use an external command to set your proxy. If you are on Windows and your proxy is already setup in your internet options, you don't need to set it up in the script at all, it will be ...