Closed 8snit closed 3 years ago
keep #153 in mind by adding custom metadata items for STAC in mapchete file
Main issue is how to handle tile directories, i.e. potentially millions of files with predictable paths. Creating one asset per file does not scale and is probably also not intended by the STAC spec but it can be implemented quickly.
Short-term solution: one asset per file Long-term solution: one asset per tile directory
@8snit @Scartography any comments?
Use structure required by GDAL 3.3: https://gdal.org/drivers/raster/stacta.html
To make this work with mapchete we have to
For the first point we can add the required metadata in the output
section of a mapchete file:
output:
path: testdata/tmp/example
format: GTiff
dtype: float32
bands: 3
stac:
id: test_output # optional
properties: # optional
whatever: property
eo:bands: # optional for STAC extensions
- name: B04
common_name: red
- name: B03
common_name: green
- name: B02
common_name: blue
links: # optional
- rel: parent
href: /path/to/parent/catalog.json
- rel: root
href: /path/to/root/catalog.json
This would then add an
For the second point we need a CLI tool and additional options for existing tools to add and/or update STAC metadata:
# to add or update STAC json
$ mapchete stac <mapchete_file or tile_directory> --stac-item-id <some-id>
# to add STAC json while using convert; per default an existing stac json should be used
$ mapchete convert <input> <output> --stac-item-id <some-id>
The STAC item id should default to the tile directory path when using a tile directory and the file basename (without extension) when using a single file output.
see https://github.com/radiantearth/stac-spec
details like how to represent the generated pyramids in best way to be discussed