|
6 | 6 | - [`null` vs. empty vs. missing](#null-vs-empty-vs-missing) |
7 | 7 | - [Examples](#examples) |
8 | 8 | - [Default fields](#default-fields) |
9 | | - - [Explicitly get a valid STAC Item](#explicitly-get-a-valid-stac-item) |
| 9 | + - [Explicitly get a valid STAC entity](#explicitly-get-a-valid-stac-entity) |
10 | 10 | - [Exclude geometry](#exclude-geometry) |
11 | 11 | - [Minimal subset](#minimal-subset) |
12 | 12 | - [Exclude a nested field](#exclude-a-nested-field) |
|
17 | 17 | - **OpenAPI specification:** [openapi.yaml](openapi.yaml) |
18 | 18 | - **Conformance Classes:** |
19 | 19 | - `STAC API - Item Search` binding: <https://api.stacspec.org/v1.0.0/item-search#fields> |
| 20 | + - `STAC API - Collections / Collection Search` binding: <https://api.stacspec.org/v1.0.0/collection-search#fields> |
20 | 21 | - `STAC API - Features` binding: <https://api.stacspec.org/v1.0.0/ogcapi-features#fields> |
21 | | -- **Scope:** STAC API - Features, STAC API - Item Search |
| 22 | +- **Scope:** STAC API - Features, STAC API - Item Search, STAC API - Collections |
22 | 23 | - **[Extension Maturity Classification](https://github.com/radiantearth/stac-api-spec/tree/main/README.md#maturity-classification):** Candidate |
23 | 24 | - **Dependencies:** |
24 | 25 | - [STAC API - Item Search](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/item-search) |
25 | | - - [STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/ogcapi-features) |
| 26 | + - [STAC API - Collections](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/ogcapi-features#stac-api---collections) |
| 27 | + - [STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/ogcapi-features#stac-api---features) |
26 | 28 | - **Owner**: none |
27 | 29 |
|
28 | | -By default, STAC API endpoints that return Item objects return every field of those Items. However, |
29 | | -Item objects can have hundreds of fields, or large |
30 | | -geometries, and even smaller Item objects can add up when large numbers of them are in results. Frequently, not all |
31 | | -fields in an Item are used, so this |
| 30 | +By default, STAC API endpoints that return Item and Collection objects return every field of those. |
| 31 | +However, Item objects can have hundreds of fields, or large geometries, |
| 32 | +Collection objects may have a large number of links, |
| 33 | +and even smaller Item or Collection objects can add up when large numbers of them are in results. |
| 34 | +Frequently, not all fields in an Item or Collection are used, so this |
32 | 35 | specification provides a mechanism for clients to request that servers to explicitly include or exclude certain fields. |
33 | 36 |
|
34 | | -This behavior may be bound to either or both of |
| 37 | +This behavior may be bound to either or both of |
35 | 38 | [STAC API - Item Search](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/item-search) (`/search` endpoint) or |
36 | | -[STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/ogcapi-features) |
| 39 | +[STAC API - Collections](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/ogcapi-features#stac-api---collections) |
| 40 | +(`/collections` endpoint) or |
| 41 | +[STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/ogcapi-features#stac-api---features) |
37 | 42 | (`/collections/{collectionId}/items` endpoint) by advertising the relevant conformance class. |
38 | 43 |
|
39 | | -When used in a POST request with `Content-Type: application/json`, this adds an attribute `fields` with |
40 | | -an object value to the core JSON search request body. The `fields` object contains two attributes with string array |
| 44 | +When used in a POST request with `Content-Type: application/json`, this adds an attribute `fields` with |
| 45 | +an object value to the core JSON search request body. The `fields` object contains two attributes with string array |
41 | 46 | values, `include` and `exclude`. |
42 | 47 |
|
43 | | -When used with GET, the semantics are the same, except the syntax is a single parameter `fields` with |
44 | | -a comma-separated list of field names, where `exclude` values are those prefixed by a `-` and `include` values are |
| 48 | +When used with GET, the semantics are the same, except the syntax is a single parameter `fields` with |
| 49 | +a comma-separated list of field names, where `exclude` values are those prefixed by a `-` and `include` values are |
45 | 50 | those with no prefix, e.g., `-geometry`, or `id,-geometry,properties`. |
46 | 51 |
|
47 | | -It is recommended that implementations provide exactly the `include` and `exclude` sets specified by the request, |
48 | | -but this is not required. These values are only hints to the server as to the desires of the client, and not a |
49 | | -contract about what the response will be. Implementations are still considered compliant if fields not specified as part of `include` |
50 | | -are in the response or ones specified as part of `exclude` are. For example, implementations may choose to always |
51 | | -include simple string fields like `id` and `type` regardless of the `exclude` specification. However, it is recommended |
52 | | -that implementations honor excludes for fields with more complex and arbitrarily large values |
53 | | -(e.g., `geometry`, `assets`). For example, some Item objects may have a geometry with a simple 5 point polygon, but these |
| 52 | +It is recommended that implementations provide exactly the `include` and `exclude` sets specified by the request, |
| 53 | +but this is not required. These values are only hints to the server as to the desires of the client, and not a |
| 54 | +contract about what the response will be. Implementations are still considered compliant if fields not specified as part of `include` |
| 55 | +are in the response or ones specified as part of `exclude` are. For example, implementations may choose to always |
| 56 | +include simple string fields like `id` and `type` regardless of the `exclude` specification. However, it is recommended |
| 57 | +that implementations honor excludes for fields with more complex and arbitrarily large values |
| 58 | +(e.g., `geometry`, `assets`). For example, some Item objects may have a geometry with a simple 5 point polygon, but these |
54 | 59 | polygons can be very large when reprojected to EPSG:4326, as in the case of a highly-decimated sinusoidal polygons. |
55 | 60 | Implementations are also not required to implement semantics for nested values whereby one can include an object, but |
56 | 61 | exclude fields of that object, e.g., include `properties` but exclude `properties.datetime`. |
57 | 62 |
|
58 | | -No error must be returned if a specified field has no value for it in the catalog. For example, if the field |
| 63 | +No error must be returned if a specified field has no value for it in the catalog. For example, if the field |
59 | 64 | "properties.eo:cloud_cover" is specified but there is no cloud cover value for an Item, a successful HTTP response |
60 | | -must be returned and the Item entities will not contain that |
61 | | -field. |
| 65 | +must be returned and the Item entities will not contain that |
| 66 | +field. |
62 | 67 |
|
63 | 68 | If no `fields` are specified, the response is **must** be a valid |
64 | | -[ItemCollection](https://github.com/radiantearth/stac-spec/tree/v1.0.0/itemcollection/README.md). If a client excludes |
65 | | -fields that are required in a STAC Item, the server may return an invalid STAC Item. For example, if `type` |
66 | | -and `geometry` are excluded, the entity will not even be a valid GeoJSON Feature, or if `bbox` is excluded then the entity |
| 69 | +[ItemCollection](https://github.com/radiantearth/stac-spec/tree/v1.0.0/itemcollection/README.md) or |
| 70 | +or list of collections (according to the specification for `GET /collections`). If a client excludes |
| 71 | +fields that are required in a STAC Item or Collection, the server may return an invalid STAC Item or Collection. For example, if `type` |
| 72 | +and `geometry` are excluded, the entity will not even be a valid GeoJSON Feature, or if `bbox` is excluded then the entity |
67 | 73 | will not be a valid STAC Item. |
68 | 74 |
|
69 | | -Implementations may return fields not specified, e.g., id, but must avoid anything other than a minimal entity |
| 75 | +Implementations may return fields not specified, e.g., id, but must avoid anything other than a minimal entity |
70 | 76 | representation. |
71 | 77 |
|
72 | 78 | This specification does not yet require the implementation of an "-ables" endpoint (like CQL2 does for queryables) |
|
212 | 218 | } |
213 | 219 | ``` |
214 | 220 |
|
215 | | -### Explicitly get a valid STAC Item |
| 221 | +### Explicitly get a valid STAC entity |
216 | 222 |
|
217 | 223 | Because implementations may choose to always include other fields (e.g., |
218 | 224 | extension-specific fields such as |
|
0 commit comments