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

WIP: Speedup get_coord_arrays #58

Merged
merged 2 commits into from
Mar 1, 2023

Conversation

emolch
Copy link

@emolch emolch commented Feb 17, 2023

Hi,

this PR should speed up the GeoTiff.get_coord_arrays method by several orders of magnitude for any larger array.

The previous implementation spent a lot of time, calling TifTransformer.get_xy for every grid node seperately. Solved by adding a method TifTransformer.get_xy_array to do the transform for all requested nodes in a single shot and letting numpy do the looping.

Sorry, I couldn't run pre-commit locally because it fails when setting up the various dependencies with pip. I cannot investigate the reason due to time constraints.

The proposed changes break some internal interfaces (_convert_coords_array now takes arrays instead of lists), therefore I label this as WIP. Please check if this is a problem.

Best wishes
Sebastian

@KipCrossing
Copy link
Owner

Hey! Thanks for this! Could you also bump the version number to 0.2.8 in the setup.py file?

Copy link
Owner

@KipCrossing KipCrossing left a comment

Choose a reason for hiding this comment

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

LGTM

@KipCrossing KipCrossing merged commit 315c93e into KipCrossing:main Mar 1, 2023
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