-
Notifications
You must be signed in to change notification settings - Fork 1
zonal statistics quickstart
If you want to just get the results of a zonal statistics query, you can run raven as follows:
# Datasets definition
zs_result = ZSGen(
raster="/data/sentinel2a_mol_band9",
vector="/data/ALKIS_bezirk_MOL") \
# Aggregation operations
.group("oid") \
.summarize({"max": ZSGen.MAX, "avg": ZSGen.AVG}) \
# Systems
.system([ZSSystem.PostGIS()]) \
# Parameter settings (optional)
.raster_tile_size("auto") \
.run()This query will calculate the zonal statistics between the cadastre vector dataset and Sentinel 2A raster dataset by grouping on the oid and create the max and avg aggregates. It will run the Query on PostGIS, which shall select the raster tile size automatically.
The result is a dataframe containing the oid as well as the aggregates as columns.
To function properly, RaVeN requires the following minimal configuration files for results mode:
| File | Description | Packaged into utility? | Required? |
|---|---|---|---|
| Host Configuration | Defines workload-independent parameters like result locations | No | Yes |
| SSH Configuration | Defines how the SSH server is accessed | No | Yes |
| Capabilities | Describes limitations of the systems | Yes | Yes |
| Raster File | The raster dataset to be used in the workload | No | Yes |
| Vector File | The vector dataset to be used in the workload | No | Yes |
Also, RaVeN requires the following software to be installed:
- ssh
- scp
- rsync
- python
- pip
- gdal (needs to fit to the version of the python package)
- docker
The host configuration acts as the static configuration for RaVeN. you can find more info in the Host Configuration reference. The referenced directories and database file on the controller and the host are created automatically if they do not exist already.
Minimal configuration as provided in controller-config.sample.yaml:
config:
controller:
results_folder: /data/results # Location of the results folder of the controller
results_db: /data/results.db # Location of the metrics database
hosts:
- host: "remote.server" # URL of the server
base_path: /data/benchipath # ST_Benchi root directory on the host
public_key_path: ~/.ssh/id_rsa.pub # Location of the SSH key to access the hostThe SSH config file contains information on how the remote server shall be accessed. Its existence is required, but it does not need explicit information on how a host can be accessed. An exemplary configuration can be found under ssh/config.default. It is necessary to copy this configuration to ssh/config before running ST_Benchi.