Add asset name mapping for stac-to-dc #640
Open
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.
Hi,
this is some code I wrote ages ago as a quick fix for a problem we had where a catalog had changed its asset names, which clashed with the old ones in the ODC database. With the fix, you can do something like this:
stac-to-dc --catalog-href https://stac.terrabyte.lrz.de/public/api --collections sentinel-2-c1-l2a --rename-product s2_c1_l2a --datetime='2024-03-01/2024-03-31' --bbox=5.9,47.3,15.0,54.9 --asset-name-mapping=B01/coastal,B02/blue,B03/green,B04/red,B05/rededge1,B06/rededge2,B07/rededge3,B08/nir,B8A/nir08,B09/nir09,B11/swir16,B12/swir22,SCL/scl,AOT/aot,WVP/wvpI'm just opening this PR as I stumbled across the code while going through stuff I did at that job (which I'm no longer employed at) and didn't want it to go to waste in case you find this interesting.
Would need error checking and documentation of course.