digitalearthpacific / dep-tools

Processing tools for Digital Earth Pacific
MIT License
1 stars 0 forks source link

STAC docs written using the LocalPath do not have the correct hrefs #17

Open alexgleith opened 11 months ago

alexgleith commented 11 months ago

Code here: https://github.com/digitalearthpacific/dep-tools/blob/main/dep_tools/writers.py#L67 hardcodes the use of Azure for asset hrefs:

az_prefix = URL("https://deppcpublicstorage.blob.core.windows.net/output")
            asset = Asset(
                media_type="image/tiff; application=geotiff; profile=cloud-optimized",
                href=str(az_prefix / path),
                roles=["data"],
            )

If we're writing to a local folder, using the LocalPath namer, we should be able to load data from the STAC Item, which would need relative or absolute hrefs on the file system.

dep_path = LocalPath(local_folder="data", sensor="s2", dataset_id="mangroves", version="0.0.0", time=datetime)