-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix issue in sentinel 2 metadata where 0 z coordinates are listed. #122
Conversation
There are some produt metadata files that contain 0 z coordinate values in the product metadata that is used to construct STAC Item geometries. This causes the Item geometry to be invalid. This change modifies the parsing logic to filter out '0' string values in the coordinates to avoid this issue.
Codecov Report
@@ Coverage Diff @@
## master #122 +/- ##
=======================================
Coverage 85.26% 85.26%
=======================================
Files 82 82
Lines 2463 2463
=======================================
Hits 2100 2100
Misses 363 363
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as is, I have three questions mostly for my own education:
- Is there chance of a boundary granule footprint that includes
0
as a x or y value that could get caught by the added check? - Are 3D geometries useful? Could this be solved by only supporting 2D?
- Does one of the test files include the bogus z value?
Looking at the precision of the other x/y values, I don't believe so, but could not guarantee it. I found it difficult to find documentation on this part of the sentinel product metadata, so there's some assumptions made here.
The example I found had all 0 values for z, which is common in a bug I've seen elsewhere where the default z values are printed out unintentionally. I have a hunch that a similar issue happened here with some scenes printing the default. I couldn't find documentation of meaningful Z footprint values.
The added test case reads an example product metadata file that was found to have the bogus Z values. |
Roger, that all sounds good to me. Once CI passes I can merge. Thanks! |
There are some product metadata files that contain 0 z coordinate values in the product metadata that is used to construct STAC Item geometries. This causes the Item geometry to be invalid. This change modifies the parsing logic to filter out '0' string values in the coordinates to avoid this issue.