A STAC catalog creator from Thredds data server
Project description
STAC specification is a method of exposing spatial and temporal data collections in a standardized manner. Specifically, the SpatioTemporal Asset Catalog (STAC) specification describes and catalogs spatiotemporal assets using a common structure. This package creates STAC metadata by harvesting dataset details from the Thredds data server. After creating STAC Catalogs, Collections, and Items, it imports them into pgSTAC and STAC-FastAPI.
Free software: EUPL-1.2
Documentation: https://tds2stac.readthedocs.io.
Installation from PyPi
pip install tds2stac
Installation for development
git clone https://codebase.helmholtz.cloud/cat4kit/tds2stac.git
cd tds2stac
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Installing using Docker
For runnig by docker use this repository.
Usage
Use case:
You can use the following template for creating STAC catalog from the TDS web service for your project.
You can change configuration of PgSTAC in config_pgstac
from tds2stac.tds2stac import Converter
from tds2stac import app
app.Harvester("https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/catalog.html",
stac = True,
stac_id = "id",
stac_description = "description",
stac_dir = "/Users/hadizadeh-m/stac/",
)
output:
INFO 2023-08-15 10:13:49,031 app.py @function __init__ line 123 - Start Scanning datasets
Start Scanning datasets of https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/catalog.xml
|__ https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/catalog.xml | Number of branches: 2
|_______ https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.05/catalog.xml | Number of data: 1
|_______ https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.1/catalog.xml | Number of data: 1
2 data are going to be set as items
2 datasets are going to be set as collction
INFO 2023-08-15 10:13:49,110 app.py @function __init__ line 196 - Harvesting datasets is started
Start processing: https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.05/catalog.xml
2 / 2 STAC catalogs are created
1 / 2 STAC items are connected to the related catalog
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.82s/it]
Start processing: https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.1/catalog.xml
2 / 2 STAC catalogs are created
2 / 2 STAC items are connected to the related catalog
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.40it/s]
Start processing: https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/catalog.xml
2 / 2 STAC catalogs are created
2 / 2 STAC items are connected to the related catalog
0it [00:00, ?it/s]
INFO 2023-08-15 10:13:52,002 app.py @function __init__ line 247 - Harvesting datasets is finished
Copyright
Copyright © 2023 Karlsruher Institut für Technologie
Licensed under the EUPL-1.2-or-later
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the EUPL-1.2 license for more details.
You should have received a copy of the EUPL-1.2 license along with this program. If not, see https://www.eupl.eu/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for TDS2STAC-2.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9024f378b0370d5899679fac326068417de94b80e44e6632f84c54b11bb2190 |
|
MD5 | 6a3181dc99c991987c9a7254c434b82c |
|
BLAKE2b-256 | 2c53e8a843e5bff003bebd21ec6506cea11b1cfce1b696d8c456fe2fe7c3ad7f |