Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bbox improvements #50

Merged
merged 10 commits into from
Nov 4, 2020
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

### Fixed
- BBOX openapi yaml to only allow 4 or 6 element arrays

## Older versions

Expand Down
7 changes: 5 additions & 2 deletions STAC-extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,11 @@ components:
required: false
schema:
type: array
minItems: 4
maxItems: 6
oneOf:
- minItems: 4
maxItems: 4
- minItems: 6
maxItems: 6
items:
type: number
style: form
Expand Down
7 changes: 5 additions & 2 deletions STAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,11 @@ components:
required: false
schema:
type: array
minItems: 4
maxItems: 6
oneOf:
- minItems: 4
maxItems: 4
- minItems: 6
maxItems: 6
items:
type: number
style: form
Expand Down
29 changes: 24 additions & 5 deletions api-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,30 @@ to get to the next page without mirroring the entire query structure back to the

Example requests can be found in the [examples document](./examples.md#paging).

## Filter Parameters and Fields
## Query Parameters and Fields

Unless otherwise noted by **Path-only**, these filters are passed as query string parameters, form parameters, or JSON
entity fields. For filters that represent a set of values, query and form parameters should use comma-separated
string values and JSON entity attributes should use JSON Arrays.
The following list of parameters is used to narrow search queries. Most all of them can be represented as
query string parameters in a GET request, or as JSON entity fields in a POST request. One parameter,
`collectionId` is designated as **Path-only**, which means it should only be used as a query string parameter.
The `collections` parameter works similarly, but takes multiple collectionId's in an array, so it can be used
with a single value array in JSON if the same functionality is desired. For filters that represent a set of values,
query parameters should use comma-separated string values (with no outer brackets \[ or \]) and JSON entity
attributes should use JSON Arrays.

### Examples

```http
GET /search?collections=landsat8,sentinel&bbox=-10.415,36.066,3.779,44.213&limit=200&datetime=2017-05-05T00:00:00Z
```

```json
{
"collections": ["landsat8","sentinel"],
"bbox": [10.415,36.066,3.779,44.213],
"limit": 200,
"datetime": "2017-05-05T00:00:00Z"
}
```

| Parameter | Type | APIs | Description |
| ----------- | ---------------- | ------------ | ----------- |
Expand All @@ -202,7 +221,7 @@ string values and JSON entity attributes should use JSON Arrays.
| collections | \[string] | STAC | Array of Collection IDs to include in the search for items. Only Items in one of the provided Collections will be searched |

Only one of either **intersects** or **bbox** should be specified. If both are specified, a 400 Bad Request response
should be returned.
should be returned. See [examples](examples.md) to see sample requests.

## Reserved Parameters

Expand Down
7 changes: 5 additions & 2 deletions openapi/OAFeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ components:
required: false
schema:
type: array
minItems: 4
maxItems: 6
oneOf:
- minItems: 4
maxItems: 4
- minItems: 6
maxItems: 6
items:
type: number
style: form
Expand Down
11 changes: 0 additions & 11 deletions openapi/STAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ components:
explode: false
# This schema extends OAFeat.yaml#/parameters/bbox.
bbox:
name: bbox
in: query
description: |-
Only features that have a geometry that intersects the bounding box are selected.
The bounding box is provided as four or six numbers, depending on
Expand Down Expand Up @@ -174,15 +172,6 @@ components:
WGS 84 (from 160.6°E to 170°W and from 55.95°S to 25.89°S) would be
represented in JSON as `[160.6, -55.95, -170, -25.89]` and in a query as
`bbox=160.6,-55.95,-170,-25.89`.
required: false
schema:
type: array
minItems: 4
maxItems: 6
items:
type: number
style: form
explode: false
responses:
# This schema extends OAFeat.yaml#/components/responses/LandingPage.
LandingPage:
Expand Down