scratch work to assign spatial:transform when creating geozarr metadata#36
Draft
kylebarron wants to merge 4 commits intomainfrom
Draft
scratch work to assign spatial:transform when creating geozarr metadata#36kylebarron wants to merge 4 commits intomainfrom
kylebarron wants to merge 4 commits intomainfrom
Conversation
kylebarron
commented
Apr 7, 2026
Comment on lines
+33
to
+34
| scale_factor_x = overview.transform.a / geotiff.transform.a | ||
| scale_factor_y = overview.transform.e / geotiff.transform.e |
Member
Author
There was a problem hiding this comment.
This is a change from the example on main. I think it's best to always calculate the scale factor in terms of both x and y, in case it differs. It does differ in some cases (such as in an NAIP sample image I use often) due to pixel rounding for overviews.
kylebarron
commented
Apr 7, 2026
Comment on lines
+47
to
+51
| multiscales_attrs["multiscales"]["layout"][0]["spatial:transform"] = list(geotiff.transform) | ||
| for item, overview in zip( | ||
| multiscales_attrs["multiscales"]["layout"][1:], geotiff.overviews, strict=True | ||
| ): | ||
| item["spatial:transform"] = list(overview.transform) |
Member
Author
There was a problem hiding this comment.
After multiscales metadata has been created, this assigns spatial:transform onto each level
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just creating a draft branch/PR to keep track of my changes to assign
spatial:transformonto multiscales metadata