Skip to content

Commit f6eb2c2

Browse files
authored
Update README with explanations of output layers (#24)
* update README with explanations of output layers * markdown linting
1 parent 97bd0ad commit f6eb2c2

1 file changed

Lines changed: 76 additions & 22 deletions

File tree

README.md

Lines changed: 76 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ The workflow in this repository is designed to:
2323

2424
1. Filter Sentinel-2 scenes by date range, AOI, tile id, and cloud cover.
2525
2. Download and import selected scenes into GRASS GIS.
26-
3. Compute NDVI and NDWI maps.
27-
4. Classify NDVI/NDWI outputs using configured categories for vegetation health
28-
assessment.
29-
5. Export raster outputs as COG.
30-
6. Create and publish STAC items to an existing STAC catalog/collection and
26+
3. Use L2A cloud probability layer to mask out clouds. Cloud proabability threshold is set to 65 %. (Could be changed in `processing/templates/template_S2_download_import.json`). See also [i.sentinel.import](https://grass.osgeo.org/grass-stable/manuals/addons/i.sentinel.import.html).
27+
4. Compute NDVI and NDWI maps.
28+
5. Classify NDVI/NDWI outputs using configured categories for vegetation health
29+
assessment. The threshold for the categorization is set in `processing/input/index_classification/*classes`.
30+
6. Export raster outputs as COG.
31+
7. Create and publish STAC items to an existing STAC catalog/collection and
3132
update collection extent metadata.
3233

3334
## Main components
@@ -158,27 +159,54 @@ From repository root folder:
158159
python processing/run_service.py
159160
```
160161

162+
#### Script parameters
163+
161164
Important script parameters to adapt before production runs:
162165

166+
**Sentinel-2 query parameters:**
167+
163168
- Time range (`START_TIME`, `END_TIME`, or automatic time range mode) for
164-
filtering Sentinel-2 scenes. Options:
165-
- autmatic time range mode: Queries given STAC collection for latest item and
166-
sets `START_TIME` accordingly and `END_TIME` to current time.
167-
- AOI: By default, the script uses a predefined AOI for Athens in
168-
`processing/input/athens_aoi.geojson`.
169-
- To use a different AOI, replace this file with a new GeoJSON containing the
170-
desired AOI geometry (and rebuild image).
171-
- Or specify a bounding box by setting `LONMIN`, `LONMAX`, `LATMIN`, `LATMAX`.
172-
- **Note**: Currently `-a` flag is set for `i.s2_id.filter` in process
173-
chain. This enables AOI filtering based on predifined AOI. For bounding
174-
box filtering `-a` flag must be removed. --> TODO: implement automatic
175-
flag removal when bounding box parameters are set.
169+
filtering Sentinel-2 scenes.
170+
171+
**Options:**
172+
1. **manual time range:** Set `START_TIME` and `END_TIME` e.g. `START_TIME = "2026-04-05"`
173+
and `END_TIME = "2026-04-10"`
174+
2. **automatic time range:** Queries given STAC collection `STAC_COLLECTION_URL`
175+
for latest item and
176+
sets `START_TIME` accordingly and `END_TIME` to current time. For the
177+
current settings, the collection `ndvi-ath` is used which is updated with
178+
each workflow run. Check with names defined in `STAC_COLLECTIONS`.
176179
- `TILE_ID`: Sentinel-2 tile identifier e.g. `34SGH` for Athens area
177-
- Max. cloud cover threshold (`MAX_CLOUD_COVER`)
178-
- Actinia base URL, processing endpoint and GRASS location settings
179-
- STAC catalog URL and collection names
180-
- STAC item metadata settings (e.g. collection extent update, item asset
181-
metadata)
180+
- `MAX_CLOUD_COVER`: Max. cloud cover threshold
181+
- AOI: By default, the script uses a predefined AOI for Athens in `processing/input/athens_aoi.geojson`.
182+
- To use a different AOI, replace this file with a new GeoJSON containing the desired AOI geometry (and rebuild image).
183+
- Or specify a bounding box by setting `LONMIN`, `LONMAX`, `LATMIN`, `LATMAX`.
184+
- **Note:** Currently `-a` flag is set for i.s2_id.filter in process chain. This enables AOI filtering based on predifined AOI. For bounding box filtering `-a` flag must be removed. --> **TODO**: implement automatic flag removal when bounding box parameters are set.
185+
186+
187+
188+
**actinia process parameters:**
189+
190+
It should not be necessary to change these parameters. To be able to reach
191+
actinia a correct actinia base URL (`ACTINIA_BASE_URL`) is required. The default
192+
of this setup is `http://localhost:8088/`.
193+
194+
**STAC parameters:**
195+
196+
- `STAC_CATALOG_URL`: Should link to the STAC catalog `"http://pycsw:8000/stac/"`
197+
- `STAC_COLLECTIONS`: Names of the STAC collections, where the created items are
198+
registered.
199+
For this workflow four collections for each product are used:
200+
`"ndvi-ath,ndvi-cat-ath,ndwi-ath,ndwi-cat-ath"`
201+
- `PRODUCT_NAMES`: Names used for the STAC items of the four products (same
202+
order as `STAC_COLLECTIONS`): `"NDVI,NDVI_categorized,NDWI,NDWI_categorized"`
203+
- `STAC_ITEM_ID_PREFIX`: Defines a prefix for the STAC item IDs: e.g.
204+
`"athen_urban_green"` so the STAC item ID will be like this
205+
`athen_urban_green_NDWI_categorized_20260218T091031`
206+
`STAC_ITEM_TITLE`: Title for STAC item. Additionally, product name and date are
207+
added to the title. E.g. `Urban Green Monitoring Athens- NDWI_categorized - 2026-02-18 09:10:31+00:00`
208+
`STAC_ITEM_DESCRIPTION`: Description for STAC item. Currently it is the same
209+
text for all products.
182210

183211
**Note for a local setup**: Adding STAC item to a collection only works if you
184212
have write access to the collection.
@@ -190,6 +218,32 @@ and include:
190218
- `dotenv`
191219
- `jinja2`
192220

221+
## Output layers
222+
223+
The main output layers are export as Cloud Optimized GeoTIFFs (COG):
224+
- NDVI (Normalized Difference Vegetation Index)
225+
- Categorized NDVI
226+
- NDWI (Normalized Difference Water Index) maps in COG format.
227+
- Categorized NDWI
228+
229+
Categorization thresholds for NDVI and NDWI are defined in `processing/input/index_classification/ndvi_4_classes` and `processing/input/index_classification/ndwi_3_classes`.
230+
231+
Uses equations:
232+
- NDVI = (NIR - Red) / (NIR + Red)
233+
- NDWI = (( NIR - SWIR ) / ( NIR + SWIR ))
234+
235+
NDVI classes (raster values in brackets):
236+
- no vegetation (1): -1 to 0.1
237+
- bare soil (2): 0.1 to 0.2
238+
- sparse/stressed vegetation (3): 0.2 to 0.5
239+
- dense/healthy vegetation (4): 0.5 to 1.0
240+
241+
NDWI classes (raster values in brackets):
242+
- barren (1): -1 to -0.1
243+
- water stress (2): 0.1 to 0.4
244+
- no water stress (3): 0.4 to 1.0
245+
246+
193247
## Troubleshooting
194248

195249
- Authentication failures:

0 commit comments

Comments
 (0)