@@ -25,42 +25,42 @@ geometries, and even smaller Item objects can add up when large numbers of them
25
25
fields in an Item are used, so this
26
26
specification provides a mechanism for clients to request that servers to explicitly include or exclude certain fields.
27
27
28
- This behavior may be bound to either or both of
28
+ This behavior may be bound to either or both of
29
29
[ STAC API - Item Search] ( https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.2/item-search ) (` /search ` endpoint) or
30
30
[ STAC API - Features] ( https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.2/ogcapi-features )
31
- (` /collections/{collectionId}/items ` endpoint) by advertising the relevant conformance class.
31
+ (` /collections/{collectionId}/items ` endpoint) by advertising the relevant conformance class.
32
32
33
- When used in a POST request with ` Content-Type: application/json ` , this adds an attribute ` fields ` with
34
- an object value to the core JSON search request body. The ` fields ` object contains two attributes with string array
33
+ When used in a POST request with ` Content-Type: application/json ` , this adds an attribute ` fields ` with
34
+ an object value to the core JSON search request body. The ` fields ` object contains two attributes with string array
35
35
values, ` include ` and ` exclude ` .
36
36
37
- When used with GET, the semantics are the same, except the syntax is a single parameter ` fields ` with
38
- a comma-separated list of attribute names, where ` exclude ` values are those prefixed by a ` - ` and ` include ` values are
37
+ When used with GET, the semantics are the same, except the syntax is a single parameter ` fields ` with
38
+ a comma-separated list of attribute names, where ` exclude ` values are those prefixed by a ` - ` and ` include ` values are
39
39
those with no prefix, e.g., ` -geometry ` , or ` id,-geometry,properties ` .
40
40
41
- It is recommended that implementations provide exactly the ` include ` and ` exclude ` sets specified by the request,
42
- but this is not required. These values are only hints to the server as to the desires of the client, and not a
43
- contract about what the response will be. Implementations are still considered compliant if fields not specified as part of ` include `
44
- are in the response or ones specified as part of ` exclude ` are. For example, implementations may choose to always
45
- include simple string fields like ` id ` and ` type ` regardless of the ` exclude ` specification. However, it is recommended
46
- that implementations honor excludes for attributes with more complex and arbitrarily large values
47
- (e.g., ` geometry ` , ` assets ` ). For example, some Item objects may have a geometry with a simple 5 point polygon, but these
41
+ It is recommended that implementations provide exactly the ` include ` and ` exclude ` sets specified by the request,
42
+ but this is not required. These values are only hints to the server as to the desires of the client, and not a
43
+ contract about what the response will be. Implementations are still considered compliant if fields not specified as part of ` include `
44
+ are in the response or ones specified as part of ` exclude ` are. For example, implementations may choose to always
45
+ include simple string fields like ` id ` and ` type ` regardless of the ` exclude ` specification. However, it is recommended
46
+ that implementations honor excludes for attributes with more complex and arbitrarily large values
47
+ (e.g., ` geometry ` , ` assets ` ). For example, some Item objects may have a geometry with a simple 5 point polygon, but these
48
48
polygons can be very large when reprojected to EPSG:4326, as in the case of a highly-decimated sinusoidal polygons.
49
49
Implementations are also not required to implement semantics for nested values whereby one can include an object, but
50
50
exclude attributes of that object, e.g., include ` properties ` but exclude ` properties.datetime ` .
51
51
52
- No error must be returned if a specified field has no value for it in the catalog. For example, if the attribute
52
+ No error must be returned if a specified field has no value for it in the catalog. For example, if the attribute
53
53
"properties.eo: cloud_cover " is specified but there is no cloud cover value for an Item, a successful HTTP response
54
- must be returned and the Item entities will not contain that
55
- attribute.
54
+ must be returned and the Item entities will not contain that
55
+ attribute.
56
56
57
57
If no ` fields ` are specified, the response is ** must** be a valid
58
58
[ ItemCollection] ( https://github.com/radiantearth/stac-spec/tree/v1.0.0-rc.2/itemcollection/README.md ) . If a client excludes
59
- attributes that are required in a STAC Item, the server may return an invalid STAC Item. For example, if ` type `
60
- and ` geometry ` are excluded, the entity will not even be a valid GeoJSON Feature, or if ` bbox ` is excluded then the entity
59
+ attributes that are required in a STAC Item, the server may return an invalid STAC Item. For example, if ` type `
60
+ and ` geometry ` are excluded, the entity will not even be a valid GeoJSON Feature, or if ` bbox ` is excluded then the entity
61
61
will not be a valid STAC Item.
62
62
63
- Implementations may return attributes not specified, e.g., id, but must avoid anything other than a minimal entity
63
+ Implementations may return attributes not specified, e.g., id, but must avoid anything other than a minimal entity
64
64
representation.
65
65
66
66
This specification does not yet require the implementation of an "-ables" endpoint (like CQL2 does for queryables)
@@ -79,18 +79,26 @@ This default is so that the entity returned is a valid STAC Item.
79
79
Implementations may choose to include other properties, e.g., ` properties.created ` , but the number
80
80
of default properties attributes should be kept to a minimum.
81
81
2 . If only ` include ` is specified, these attributes should be the only attributes included.
82
- 3 . If only ` exclude ` is specified, these attributes should be subtracted from the full item.
83
- This may result in an entity that is not a valid STAC Item.
82
+ If additional fields are provided beyond those in the ` include ` list, the number and size of
83
+ these attributes should be kept to a minimum.
84
+ 3 . If only ` exclude ` is specified, these attributes fields should not be
85
+ included in the response Item object, but every other fields available for the
86
+ Item should be included.
84
87
4 . If ` exclude ` is specified and ` include ` is null or an empty
85
88
array, then the ` exclude ` attributes should be excluded from the default set.
86
- This may result in an entity that is not a valid STAC Item.
87
- 5 . If a key is in ` exclude ` , and a sub-key is in ` include ` , the sub-key should be included, but no other fields
88
- in the key should be included. For example, if ` properties ` is excluded and ` properties.datetime ` is included, then ` datetime `
89
- should be the only attribute in ` properties ` .
90
- 6 . If a key is in ` include ` , and a sub-key is in ` exclude ` , the key should be included, and the sub-key should be excluded.
91
- For example, if ` properties ` is included and ` properties.datetime ` is excluded, then ` datetime `
92
- should not be in ` properties ` .
93
- 7 . If the same attribute is present in both ` include ` and ` exclude ` , it should be included.
89
+ 5 . For nested attributes (e.g. ` properites.datetime ` ), the most specific path
90
+ should be honored first, and ` include ` should be preferred over ` exclude ` . For
91
+ example:
92
+ 1. If a field is in ` exclude ` , and a nested attribute of that field is in
93
+ ` include ` , the nested attribute should be included, but no other nested
94
+ attributes in the field should be included. For example, if ` properties ` is
95
+ excluded and ` properties.datetime ` is included, then ` datetime `
96
+ should be the only nested attribute in ` properties ` .
97
+ 2. If a field is in ` include ` , and a nested attribute is in ` exclude ` , the field
98
+ should be included, and the nested attribute should be excluded. For example,
99
+ if ` properties ` is included and ` properties.datetime ` is excluded, then
100
+ ` datetime ` should not be in ` properties ` .
101
+ 6 . If the same field is present in both ` include ` and ` exclude ` , it should be included.
94
102
95
103
## Examples
96
104
138
146
}
139
147
```
140
148
141
- Exclude ` geometry ` from the full item. This ** must ** return an entity that is not a valid GeoJSON Feature or a valid STAC Item.
149
+ Exclude ` geometry ` from the full item. This will return an entity that is not a valid GeoJSON Feature or a valid STAC Item.
142
150
143
151
Query Parameters
144
152
159
167
```
160
168
161
169
Return the ` id ` , ` type ` , ` geometry ` , and the Properties attribute ` eo:cloud_cover ` .
162
- This might not return a valid STAC Item, since not all required Item attributes are included.
170
+ This is not guaranteed not return a valid STAC Item, since not all required Item
171
+ attributes are included, but an implementor may choose to return a valid STAC
172
+ item anyways.
163
173
164
174
Query Parameters
165
175
0 commit comments