When defining fields directly within an Item's properties object, follow these recommendations to ensure compatibility with legacy GeoJSON software and to avoid conflicts with STAC core logic:
- Avoid Nested Objects: Do not use objects for grouped attributes (e.g.,
"date_range": {"start": "...", "end": "..."}). This makes searching more complex and is harder for some software to display. - Avoid Arrays for Data: Do not use arrays to represent structured data (e.g.,
"date_range": ["start", "end"]). This conflicts with STAC's summaries field, which treats arrays as unordered/sorted enumerations. - Use Flattened Attributes (Recommended): Use multiple separate fields with a similar naming scheme (e.g.,
"date_range_start": "...", "date_range_end": "..."). This is the most compatible approach for GeoJSON-only software.
Note: These restrictions apply specifically to the Item's properties object. For other levels (like the root of an Item or within an array like bands), you are free to use arrays of objects.
// RECOMMENDED: Flattened fields
"properties": {
"date_range_start": "2018-01-01",
"date_range_end": "2018-01-31"
}
// DISCOURAGED: Nested object
"properties": {
"date_range": {"start": "2018-01-01", "end": "2018-01-31"}
}
// DISCOURAGED: Array
"properties": {
"date_range": ["2018-01-01", "2018-01-31"]
}