Skip to content

Conversation

@tmorganbrown
Copy link
Contributor

I'm not sure if this reverted or I never tired the fix, but it doesn't work with my risk maps unless I calculate the max directly with numpy.

I'm not sure if this reverted or I never tired the fix, but it doesn't work with my risk maps unless I calculate the max directly with numpy.
Copy link
Member

@YaoTingYao YaoTingYao left a comment

Choose a reason for hiding this comment

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

Check if max_value is None to optimize processing for rasters with metadata without loading the entire array, and calculate max_value for rasters without metadata.

max_value = in_band.GetMaximum()
if max_value is None:
    # Calculate max_value for rasters without metadata
    max_value = np.max(arr)

@YaoTingYao
Copy link
Member

Hi @tmorganbrown, I've made change requests in the previous PR. This change would check if max_value is None to optimize processing for rasters with metadata without loading the entire array, and calculate max_value for rasters without metadata.

Please commit these changes to your branch so I can merge the PR. Alternatively, I can merge the PR first and make the changes afterward. Please let me know your preference. Thx!

@YaoTingYao
Copy link
Member

Hi @tmorganbrown, I will merge the PR firstly and make the changes afterward. Thanks again for your feedback and contribution. Cheers!

@YaoTingYao YaoTingYao merged commit 28c0f9d into ClarkCGA:main Jul 15, 2024
@tmorganbrown tmorganbrown deleted the patch-3 branch July 17, 2024 10:39
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