Skip to content

Composite

In many cases, it is common to have a collection with multiple items of different data types. There are two ways to serialise multiple items at once into a collection, either using an aggregated config file, or using multiple config files.

In this tutorial, we will be describing the asset Werribee.geojson, vegetation_cover.tif, and soil_data.csv from the previous tutorials.

Note that regardless of which method is used, each config entry must be a valid config, and the id for each config entry must be unique. The program will raise an error if either of those conditions are not fulfilled.

Multiple config files

Prepare the configs as described in the previous tutorials:

Then run the following command:

stac_generator serialise \
  vector_simple_config.json\
  raster_custom_config.json\
  point_simple_config.json

To serialise items from multiple configs, we simply add the configs as positional parameters in the command line application.

An aggregated config

To prepare an aggregated config, we simply add config item entries as a list to the config file:

composite_config.json
[
  {
    "id": "Werribee",
    "location": "Werribee.geojson",
    "collection_date": "2025-01-01",
    "collection_time": "00:00:00"
  },
  {
    "id": "vegetation_cover",
    "location": "vegetation_cover.tif",
    "collection_date": "2021-02-21",
    "collection_time": "10:00:17",
    "band_info": [
      {
        "name": "vegetation",
        "description": "Vegetation cover level"
      }
    ]
  },
  {
    "id": "soil_data",
    "location": "soil_data.csv",
    "collection_date": "2020-01-01",
    "collection_time": "10:00:00",
    "X": "Longitude",
    "Y": "Latitude",
    "epsg": 4326,
    "column_info": [
      {
        "name": "Ca_Soln",
        "description": "Calcium solution in ppm"
      },
    ]
  }
]
composite_config.yaml
- id: "Werribee"
  location: "Werribee.geojson"
  collection_date: "2025-01-01"
  collection_time: "00:00:00"
- id: vegetation_cover
  location: vegetation_cover.tif
  collection_date: '2021-02-21'
  collection_time: '10:00:17'
  band_info:
  - description: Vegetation cover level
    name: vegetation
- id: soil_data
  location: soil_data.csv
  epsg: 4326
  X: Longitude
  Y: Latitude
  collection_date: '2020-01-01'
  collection_time: '10:00:00'
  column_info:
  - description: Calcium solution in ppm
    name: Ca_Soln

The collection can then be generated by running the command:

stac_generator serialise composite.json