-
Notifications
You must be signed in to change notification settings - Fork 29
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
ASTER, Landsat 8 C2 L2, Sentinel 2 L2A #83
Conversation
map_opts is a Monad map. Testing generics with python. VSCode understands the genericized output but does not show an error when the T in the v parameter does not match the T in the fn parameter.
This commit modifies the aster subpackage to break apart the creation of the cogs from the creation of the stac items. It also bases the stac item creation mostly on the XML metadata. It drops a lot of noisey metadata an generates more pertinent STAC metadata, like additional assets and proj information.
The extended item was created to avoid too much noisey data in Sentinel 2 Items; however there's not that much metadata and it complicates things to have multiple items, so reverting to a single item for now.
Currently the cogification would attempt to refactor all assets, even metadata assets. As this functionality needs some work and testing, remove the option from the command for now.
Set through the "descriptions" property of rasterio
Refactored to core from sentinel2 logic
27990c7
to
95396f1
Compare
Codecov Report
@@ Coverage Diff @@
## master #83 +/- ##
==========================================
+ Coverage 83.81% 85.41% +1.60%
==========================================
Files 65 74 +9
Lines 1643 2139 +496
==========================================
+ Hits 1377 1827 +450
- Misses 266 312 +46
Continue to review full report at Codecov.
|
5df1c1e
to
f96ada4
Compare
f96ada4
to
f8533f9
Compare
This bug caused SafeManifest to error when working with remote hrefs.
b078b4e
to
eb4cd5a
Compare
These can be NaN, and can be parsed out of linked metadata if necessary. Also, ensure no None values are returned.
eb4cd5a
to
95cb373
Compare
- Remove LinkType reference - move_assets now explicilty sets relative or absolute - HREF (defaulting to relative, as copying in assets is useful for self contained catalogs) - Fix landsat convert, which needed to clear hierarchical links in the cloned item
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.
A couple of documentation lints
This symlink goes outside of the repo, so I'm guessing it was an inadvertant add.
The 0.1.1 version tag was causing non-failing error text during cibuild.
@gadomski thanks for taking a look - I made the docstring changes you suggested. I also cherry-picked a couple commits from your threedep branch to get tests passing. |
Only include the view:off_nadir property if it existed in the metadata. Also, off_nadir is required to be positive, so take the absoluate value of the pointing angle.
I agree this is a hard problem. In the past I've used WRS-2 geometries because despite having I think larger errors than the ANG file, iirc they're the only method that underestimates the valid geometry? And for mosaicking it can be nice to not overestimate geometries, which could produce missing data seams in the final output. But I don't have a strong opinion on what you should use here. |
See my post in Sentinel-1 for a possible approach to generate the footprints: This would at least be a good option to have in stactools for any data that might not even have a footprint to begin with. |
@kylebarron from what I could tell from putting footprints into qgis, the ANG was an over-representation, i.e. the ANG footprint covered the actual footprint. However I didn't test this exhaustively. @matthewhanson I agree that stactools should have some footprint extraction logic, as that's pretty doable if not a lot slower. Thanks for adding #85; this could be added and incorporated in a follow up to this PR |
Yes I believe that's correct, though I haven't looked at it extensively. I was just saying that for some use cases it's helpful to have an under-representation so that you don't have seams. |
This code only handles single-granule products. The cloud_coverage_assessment removed here is handled by eo:cloud_cover, taken from the granule. The degraded data percentage is removed at the product level and added at the granule level.
This information seems really great, especially if we can enable search over those properties.
Also sprinkle in some type information.
Ah, thanks for clarifying. I definitely agree. |
Thanks everyone for taking a look - y'all are awesome! |
This PR is a set of changes across these three datasets. The changes included a lot of cross-project refactoring, and with more time I would have liked to separate out the changes into their own pull requests.
Changes for each dataset:
ASTER
The processing workflow for aster changed from creating as STAC item from HDF and then COGs from the item, to creating COGs from the HDF and then a STAC Item from the HDF XML and COGs.
There was a lot of noisy data being pulled from the HDF metadata, and that is removed. An attempt is made only to include the relevant information into the STAC Items. If additional metadata is needed, the original metadata XML file is an asset and can be further processed.
Reading from the XML data avoid opening and raster headers, which is a preferred approach - if you don't have to open the data, better to skip it and avoid the performance hit!
Sentinel 2
The command for creating Sentinel 2 STAC items included cogification logic that was not fully tested, and is best to later refactor into a workflow where COGification is a pre-cursor step to STAC-ification.
I decided to pull out the "extended item" production from Sentinel 2 STAC creation - there aren't that many
s2
properties, and it didn't seem worth the downstream complexity of managing two items. In the future we might even want to pull out some of the s2 added properties if they are encapsulated in metadata aren't super valuable to hold onto in the Item.Landsat 8 Collection 2 Level 2
Added a "create_item" command to Landsat 8 subpackage. This creates a STAC Item directly from product data, as opposed to converting the 0.7 STAC Items. This includes adding the projection information required by stac-vrt.
Some choices by the USGS STAC that I didn't follow:
landsat:processing_level
property that matches the MTL metadata with values ofL2SP
orL2SR
that will determine whether or not the thermal assets are available.landsat:wrs_path
andlandsat:wrs_row
use strings like USGS's Item, but left pad with zeros to 3 digits (which matches it's usage in paths)Some remaining issues:
@matthewhanson @kylebarron @alexgleith if you'd like to take a look and see what you think, that'd be appreciated. This was a lot of code done quickly, but I tried to be pretty careful and test along the way, so I'm reasonably confident in merging this as an improvement to the existing codebase. I'd like to merge this in in the next week - I'll be using this branch for some ETL jobs in the near term and will update with anything I find.