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

Add compression on raster save #84

Closed
AdrienWehrle opened this issue Dec 7, 2022 · 4 comments
Closed

Add compression on raster save #84

AdrienWehrle opened this issue Dec 7, 2022 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@AdrienWehrle
Copy link
Owner

AdrienWehrle commented Dec 7, 2022

There is currently no compression specified for the creation of the different rasters. Let's add an option for compression.

Mainly happening here through output_meta:

earthspy/earthspy/earthspy.py

Lines 1065 to 1067 in 9ee52fb

# write mosaic
with rasterio.open(date_output_filename, "w", **output_meta) as dst:
dst.write(mosaic)

@AdrienWehrle AdrienWehrle added the enhancement New feature or request label Dec 7, 2022
@AdrienWehrle AdrienWehrle added the good first issue Good for newcomers label Nov 21, 2024
@Antsalacia
Copy link
Collaborator

Where should I put the compression option ?

@AdrienWehrle
Copy link
Owner Author

I think best would be to have it in set_query_parameters and set to no compression by default. Then user can pass various compressions that correspond to rasterio compression options.

You can see how to compress on save with rasterio eg here. Then I think passing the compress argument in the output_metadata update here should work.

@AdrienWehrle
Copy link
Owner Author

A get_raster_compression method could be added here where we'd make sure only compression keywords matching rasterio's are passed. Otherwise raise an Error.

@AdrienWehrle
Copy link
Owner Author

closed by #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants