KipCrossing / geotiff

A noGDAL tool for reading and writing geotiff files
GNU Lesser General Public License v2.1
216 stars 23 forks source link

WIP: Speedup get_coord_arrays #58

Closed emolch closed 1 year ago

emolch commented 1 year ago

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 commented 1 year ago

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