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

In GDALDataset, lazy compute of band min max for cell type #3162

Merged
merged 2 commits into from
Dec 9, 2019
Merged

In GDALDataset, lazy compute of band min max for cell type #3162

merged 2 commits into from
Dec 9, 2019

Conversation

vpipkt
Copy link
Member

@vpipkt vpipkt commented Dec 9, 2019

Overview

Reinstates the lazy declaration of the raster band min max variable as in https://github.com/geotrellis/geotrellis-gdal/pull/40/files#diff-5e19e2811cf054c87ebc2afd642ebaa3R64

That lazy declaration has a subtle role with the by-name min max parameter in GDALUtils.dataTypeToCellType. If not lazy, then the min-max is computed even though it is only used in one case. This can result in a lot of unnecessary I/O.

Checklist

  • docs/CHANGELOG.rst updated, if necessary
  • Module Hierarcy updated, if necessary
  • docs guides update, if necessary
  • New user API has useful Scaladoc strings
  • Unit tests added for bug-fix or new feature

Notes

This change is only oriented at improving performance. It should not change any behavior in the computation of the CellType.

Closes #3148

Copy link
Member

@pomadchin pomadchin left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for fixing that; merging once CI is happy!

@pomadchin pomadchin merged commit 7a6355d into locationtech:master Dec 9, 2019
@vpipkt vpipkt deleted the fix/3148-lazy-mm branch December 9, 2019 16:26
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.

Reduce unnecessary get_band_min_max calls in computing CellType
2 participants