COG/STAC Generator with Docker
Overview
This is a generator that takes GeoTIFF data and configuration json file as input data and generates COG and STAC files that can be used as JAXA Earth Database for API.
How to use the generator
First, install Docker in your environment. Second, download the file below and unzip.
Third, change your current directry to the location of the Dockerfile. Then, command it.:
$ docker-compose up -d --build
You can execute main.py in docker container to generate COG/STAC.
Description of input parameters
Parameters in main.py
Set parameters in main.py.
Parameters |
Description |
---|---|
root_local |
Location of COG/STAC output on your environment |
bucket |
bucket name to be used |
ftype |
Fixed with “cog” |
version_path |
Fixed with “v1” |
version_full |
STAC version in JAXA Earth API |
Preparation of GeoTIFFs
Prepared GeoTIFFs must be placed under the date folder as follows. The generator detects dates by folder.
- sample_geotiff
- 2020-01-01
sample_LST.tif
sample_LST_QA_flag.tif
- 2020-01-09
sample_LST.tif
sample_LST_QA_flag.tif
The types of date folders are as follows.
date type |
example |
description |
---|---|---|
YYYY-MM-DD |
2022-01-01, 2022-12-31, etc |
Daily, 8-day, half-monthly data |
YYYY-MM |
2022-01, 2022-12, etc |
Monthly data |
YYYY |
2022, 2023, etc |
Yearly data |
DDD |
001, 365, etc |
Daily normal data |
MM-DD |
01-01, 12-31, etc |
Half-monthly normal data |
MM |
01, 12, etc |
Monthly normal data |
Configuration parameters in json
The parameters entered into this json file are used to locate the GeoTIFF file and to generate the STAC file.
name |
parent |
child |
description |
---|---|---|---|
id |
N/A |
N/A |
Product ID |
description |
N/A |
N/A |
Description of product |
title |
N/A |
N/A |
title of product |
keywords |
N/A |
N/A |
keywords of product. platform, sensor, provider, etc. |
providers |
N/A |
name, roles, url |
providers information list |
name |
providers |
N/A |
providers name |
roles |
providers |
N/A |
providers roles list |
url |
providers |
N/A |
providers URL |
license |
N/A |
N/A |
Fixed with “proprietary” |
extent |
N/A |
spatial, temporal |
Spatial and temporal extent of product |
spatial |
extent |
bbox |
Spatial extent of product |
bbox |
spatial |
N/A |
bounding box of product |
temporal |
extent |
interval |
Temporal extent of product |
interval |
temporal |
N/A |
Interval extent of product |
duration |
N/A |
N/A |
Duration of product.
|
summaries |
N/A |
platform, instrument, je:epsg, je:stad_date_format, je:cog_level_max, je:ppu_max, je:stac_version |
Summaries of product |
platform |
summaries |
N/A |
Platform of product |
instrument |
summaries |
N/A |
Instrument/Sensor of product |
je:epsg |
summaries |
N/A |
EPSG of product.
|
je:stac_date_format |
summaries |
N/A |
Date format of STAC.
|
je:cog_level_max |
summaries |
N/A |
Maximum COG level of product. |
je:ppu_max |
summaries |
N/A |
Maximum PPU (Pixel Per Unit) of product. |
je:stac_version |
summaries |
N/A |
STAC version of product. |
sci:publications |
N/A |
N/A |
Publication list about product. |
assets |
N/A |
multiple product names |
Assets of product name. Specify the name. ex. NDVI_AVE |
product name (be modified) |
assets |
title, roles, classification:classes, source, cog |
Product’s source location and conversion parameters |
title |
product name |
N/A |
title of product |
roles |
product name |
N/A |
Roles of product list.
|
classification:classes |
product name |
N/A |
class data of product. |
source |
product name |
path, dn dn2value |
GeoTIFF source’s information |
path |
source |
dir, wildcard layer_number |
GeoTIFF source’s path information |
dir |
path |
N/A |
GeoTIFF source’s directory |
wildcard |
path |
N/A |
Wild card for searching and detecting GeoTIFF files |
layer_number |
path |
N/A |
Layer number in GeoTIFF files |
dn |
source |
data_type, nodata, error |
Digital Number information in GeoTIFF files |
data_type |
dn |
N/A |
Data types of GeoTIFF files
|
nodata |
dn |
N/A |
nodata value in GeoTIFF files |
error |
dn |
N/A |
error values in GeoTIFF files |
dn2value |
source |
slope, offset |
conversion parameter slope/offset |
cog |
product name |
value, dn2value, dn, pint |
Output COG’s information |
value |
cog |
def_interp, unit |
Output COG value’s information |
def_interp |
value |
N/A |
COG value’s interpolation method.
|
unit |
value |
N/A |
Unit of product |
dn2value |
cog |
slope, offset |
conversion parameter slope/offset |
dn |
cog |
data_type, min, max, nodata |
Digital Number information in COG |
data_type |
dn |
N/A |
Data types of COG
|
min |
dn |
N/A |
minimum value in COG |
max |
dn |
N/A |
maximum value in COG |
nodata |
dn |
N/A |
nodata value in COG |
pint |
cog |
N/A |
Photometric interpritation in COG
|
links |
N/A |
rel, href, type |
Links for license |
rel |
links |
N/A |
links category |
href |
links |
N/A |
links URL |
type |
links |
N/A |
links Type |