You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
The calculation of a buffer around a point is currently done using: airports.geometry = airports.geometry.buffer(meters_to_degrees(8046.72)) #equal to 5 miles in meters
where the function meters_to_degrees is given by:
def meters_to_degrees(distance_meters):
'''https://sciencing.com/convert-distances-degrees-meters-7858322.html (111,139)'''
distance_degrees = (distance_meters / 111194.926644559) # number derived from matlab calculations
return distance_degrees
This function is an approximation. There is a better way to do distances in geopandas.
The correct way to do it is to convert the geodataframe from a geographic projection (such as epsg:4326) to one that is natively in meters such as (epsg:3857), do the buffering in that CRS, and then convert back to the original projection.
For example (assuming the airports original crs was epsg:4326):
The calculation of a buffer around a point is currently done using:
airports.geometry = airports.geometry.buffer(meters_to_degrees(8046.72)) #equal to 5 miles in meters
where the function
meters_to_degrees
is given by:This function is an approximation. There is a better way to do distances in geopandas.
The correct way to do it is to convert the geodataframe from a geographic projection (such as epsg:4326) to one that is natively in meters such as (epsg:3857), do the buffering in that CRS, and then convert back to the original projection.
For example (assuming the airports original crs was epsg:4326):
This should be done anywhere
meters_to_degrees
is used.The text was updated successfully, but these errors were encountered: