-
Notifications
You must be signed in to change notification settings - Fork 34
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
STAC collection to Product definition #148
Comments
I'm starting to work on this now. Main issue with One way to work around this issue is to inspect STAC Assets with an assumption that assets with the same name are consistent across STAC Items. Other option is to ask user for that information, for example user might provide a dictionary from band name to Other piece of information that is needed is "fill value" for each band, what value to use for pixels not covered by any dataset. Same story here, one can either lookup |
Yes, it is tricky. I finally ended up adding a custom |
Ideally pixel data type would be part of this extension: https://github.com/stac-extensions/eo#band-object @gadomski was suggesting we propose additions to Would be nice to have information for every data band in a collection (without needing to fetch sample pixel imagery)
|
Apologies if this is a slightly different aspect of this issue, but I am running into issues that relate to the In the USGS STAC API - https://ibhoyw8md9.execute-api.us-west-2.amazonaws.com/prod or https://landsatlook.usgs.gov/stac-server/ each Collection is a combination of all Landsat platforms, with of course clear differences between LS5, LS7, LS8, etc. For example LS7 vs LS8 both part of the same collection but of course with LS7 missing coastal aerosol and the other obvious differences. As an initial workaround, I am successfully overriding the |
For Digital Earth Africa, we added a field The reasoning is that the ODC doesn't handle missing bands by default, and since some scenes have SR and some have ST and some have both, we needed two products there. And as you note, some bands are both different with the same name, or added, between platforms. Providing a way to split a collection into different products would be nice. I don't know the best way to do it, aside from hard-coding it. Or by encouraging the adoption of an ODC Extension for STAC, which could specify it. |
I think the easiest place to fix this issue is in coastal:
path: _ to indicate that this dataset is "aware" of the |
Yes, this is effectively what I am going to do, but am doing so by changing the product name and then passing the relevant query params (e.g. platform=LANDSAT_8) to the STAC API. That way I can keep using the scripts that you guys have put together and get running quickly. For me, the model of passing a specific query to an API and then telling it exactly which product that I would like to add it to fits well and gives a suitable level of control. Having the ability to permit absent bands (in a controlled way) could be useful though as well. |
This is what I am doing (please note that this is not production code, and is highly likely to break, but just demonstrates the use case):
|
I just realised that the handling of the product name for Sentinel 2 from the collection name of "sentinel-s2-l2a-cogs" (in the Element84 API) to "s2_l2a" is hard-coded in transform.py. Just a note that this may not work for all, highlighting the need to be able to provide a custom product name prior to passing to stac_api_to_odc - odc-tools/libs/stac/odc/stac/transform.py Line 92 in 237692e
|
Hi @JonDHo yes, this was hardcoded a long time ago... I think you're right, that we should enable passing in a product name. I'm not sure how to achieve it, currently, but it's a good idea. |
This is my current solution which lets me continue to use the majority of the stac_api_to_dc functions without having to fork and maintain. I simply override the import odc.apps.dc_tools.stac_api_to_dc as stac
product_override = "my_custom_name" # In reality is passed in as an Argo variable
### LOTS OF OTHER STUFF ###
def process_item_new(
item: Item,
dc: Datacube,
doc2ds: Doc2Dataset,
update_if_exists: bool,
allow_unsafe: bool,
rewrite: Optional[Tuple[str, str]] = None,
):
meta, uri = stac.item_to_meta_uri(item, rewrite)
meta['product']['name'] = product_override # Replace the product name after the meta object has been created
odcutils.index_update_dataset(
meta,
uri,
dc,
doc2ds,
update_if_exists=update_if_exists,
allow_unsafe=allow_unsafe,
)
# If a value has been provided to the product_override variable, swap out the function.
if product_override:
stac.process_item = process_item_new |
Hey @JonDHo it shouldn't be too hard to make that an option on the CLI. Feel free to send a PR to make the change. |
Greetings,
I'm trying to add some product definition into the odc using the STAC collection definition, similarly to what
odc-tools/libs/index/odc/index/stac.py
Line 199 in 4c017f6
Is there any library/tool for doing so?
Thanks,
Juan
The text was updated successfully, but these errors were encountered: