Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Use of meters_to_degrees is inappropriate in Geospatial_Hurricane_Analysis #52

Open
jeffliu-LL opened this issue Oct 30, 2020 · 1 comment

Comments

@jeffliu-LL
Copy link

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):

airports = airports.to_crs(epsg=3857)
airports.geometry = airports.geometry.buffer(8046.72)
airports = airports.to_crs(epsg=4326)

This should be done anywhere meters_to_degrees is used.

@aweinert-MIT
Copy link
Member

Adding @rearley516 for awareness

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants