Skip to content

Can't build from static STAC Catalog which has local file paths #27

@maawoo

Description

@maawoo

Thanks for reaching out in Jena-Earth-Observation-School/sdc-tools#43, @print-sid8.

The rasteret version I am running is 0.3.12. As the title says, we are using static STAC Catalogs on a fileserver connected to our university HPC system. The data is mirrored from Digital Earth Africa (see here for their metadata explorer of the s2_l2a product and here for an example STAC Item). The Items of our mirrored dataset differ only by using a relative path for each asset's href but seems like this should not be an issue?

First of all, if I run the following:

collection = rasteret.build_from_stac(
    name="sdc-s2-l2a",
    stac_api="file:///geonfs/02_vol3/SaldiDataCube/original_data/S2_L2A/catalog.json",
    collection="S2_L2A_catalog",
    static_catalog=True,
)

It takes 18 minutes to run into this error (not sure what happens in this time, but maybe the error could be raised earlier?):

ValueError: COG header enrichment produced no band metadata. Verify your band_map points to tiled COG assets and that the STAC items include those assets.

When adding a basic band_map dict

band_map = {
    "B01": "B01",
    "B02": "B02",
    "B03": "B03",
    "B04": "B04",
    "B05": "B05",
    "B06": "B06",
    "B07": "B07",
    "B08": "B08",
    "B8A": "B8A",
    "B09": "B09",
    "B11": "B11",
    "B12": "B12",
    "SCL": "SCL",
}

collection = rasteret.build_from_stac(
    name="sdc-s2-l2a",
    stac_api="file:///geonfs/02_vol3/SaldiDataCube/original_data/S2_L2A/catalog.json",
    collection="S2_L2A_catalog",
    static_catalog=True,
    band_map=band_map,
)

I am getting errors that rust panicked:

Image

See error_log1.txt for the full error log.

When changing the stac_api path to "/geonfs/02_vol3/SaldiDataCube/original_data/S2_L2A/catalog.json", the error changes to the following:

OSError: Failed to fetch bytes from /geonfs/02_vol3/SaldiDataCube/original_data/S2_L2A/34JCN/2018/1/S2A_34JCN_20180106_0_L2A/B01.tif: relative URL without a base

See error_log2.txt for the full error log.

Not sure if I should do something differently or if this is a bug in rasteret?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions