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

Fast geometry to_projection when dst crs matches src crs. #147

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

favyen2
Copy link
Collaborator

@favyen2 favyen2 commented Mar 3, 2025

The main motivation was to increase the speed of rtree index creation in the gcp_public_data data source. It seems rasterio.warp.transform_geom takes 10+ ms even when the src/dst CRS are the same, so skipping the call saves a lot of time when we are doing many re-projections.

The main motivation was to increase the speed of rtree index creation in the
gcp_public_data data source. It seems rasterio.warp.transform_geom takes 10+
ms even when the src/dst CRS are the same, so skipping the call saves a lot
of time when we are doing many re-projections.
Copy link
Collaborator

@APatrickJ APatrickJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've made this same optimization in the past. I was curious if there's an equivalence check similar to what pyproj offers, but as these are rasterio.crs objects I didn't find one. Anyway, I'm sure this is already a huge win!

@favyen2 favyen2 merged commit b037c61 into master Mar 4, 2025
4 checks passed
@favyen2 favyen2 deleted the favyen/fast-geometry-reprojection branch March 4, 2025 22:06
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

Successfully merging this pull request may close these issues.

2 participants