Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants