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

Be aware of CRS #4

Open
eliasm56 opened this issue Feb 5, 2024 · 0 comments
Open

Be aware of CRS #4

eliasm56 opened this issue Feb 5, 2024 · 0 comments

Comments

@eliasm56
Copy link

eliasm56 commented Feb 5, 2024

Thank you for the wonderful code. I have a deep learning model trained for building detection and this repo had exactly what I needed to create presentable polygons. The only thing I will say is that you need to be careful with CRS. If you are working with polygons in a specific CRS that is not WGS84, you will receive an error. As referenced below, WGS84 is hard-coded into the algorithm, so please be aware that you will need to change these hard-coded CRS values or reproject your original data for the operation to work.

# Create WGS84 referenced GeoSeries
bS = gpd.GeoDataFrame({'geometry':[polySimple]})
bS.crs = "EPSG:4326"
# Temporary reproject to Merkator and rotate by median angle
bSR = bS.to_crs('epsg:3857')
bSR = bSR.rotate(angle, origin='centroid', use_radians=False)
bSR = bSR.to_crs('epsg:4326')

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

1 participant