Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions ogcapi-features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [Endpoints](#endpoints)
- [Examples](#examples)
- [Example Landing Page for STAC API - Features](#example-landing-page-for-stac-api---features)
- [Example Collection for STAC API - Features](#example-collection-for-stac-api---features)

*based on [**OGC API - Features - Part 1: Core**](https://www.ogc.org/standards/ogcapi-features)*

Expand Down Expand Up @@ -43,7 +44,7 @@ The core OGC API - Features endpoints are shown below, with details provided in
| `/collections/{collectionId}/items/{featureId}` | [Item](../stac-spec/item-spec/README.md) | Returns single Item (GeoJSON Feature) |
| `/api` | OpenAPI 3.0 JSON | Returns an OpenAPI description of the service from the `service-desc` link `rel` - not required to be `/api`, but the document is required |

The OGC API - Features is a standard API that represents collections of geospatial data. It defines the RESTful interface
The OGC API - Features is a standard API that represents collections of geospatial data. It defines a RESTful interface
to query geospatial data, with GeoJSON as a main return type. With OAFeat you can return any `Feature`, which is a geometry
plus any number of properties. The core [STAC Item spec](../stac-spec/item-spec/README.md)
enhances the core `Feature` with additional requirements and options to enable cataloging of spatiotemporal 'assets' like
Expand All @@ -65,8 +66,15 @@ In OAFeat, Features are the individual records within a Collection and are usual
is outside the scope of STAC API, as the [STAC Item](../stac-spec/item-spec/item-spec.md) is
specified in GeoJSON.

A typical OAFeat will have multiple collections, and each will just offer simple search for its particular collection at
`GET /collections/{collectionId}/items`. It is recommended to have each OAFeat Collection correspond to a STAC Collection,
A typical OAFeat will have multiple collections. Simple search for items within a collection can be done
with the resource endpoint `GET /collections/{collectionId}/items`. This endpoint should be exposed via a
link in the Collection with `rel=items`, as shown in the [Example Landing Page diagram](../overview.md#example-landing-page).
Unlike static STAC catalogs, it is recommended **not** to use `item` relations, but instead rely on
the collection resource linking to a paginated endpoint returning items through a link relation
`items`, e.g., `/collections/{collectionId}` has a link with relation `items` linking
to `/collections/{collectionId}/items`.

It is recommended to have each OAFeat Collection correspond to a STAC Collection,
and the `/collections/{collectionId}/items` endpoint can be used as a single collection search. Implementations may **optionally**
provide support for the full superset of STAC API query parameters to the `/collections/{collectionId}/items` endpoint,
where the collection ID in the path is equivalent to providing that single value in the `collections` query parameter in
Expand Down Expand Up @@ -159,3 +167,41 @@ the [overview](../overview.md#example-landing-page) document.
]
}
```

## Example Collection for STAC API - Features

The landing page `data` relation points to an endpoint to retrieve all collections. Each collection then has
a link relation to its `items` resource through the link with a rel value `items`. Note here that, unlike
as is typical with a static STAC Collection, there are no links here with rel value `item`.

`https://stacserver.org/collections/aster-l1t`

```
{
"id": "aster-l1t",
"type": "Collection",
"title": "ASTER L1T",
"links": [
{
"rel": "items",
"type": "application/geo+json",
"href": "https://stacserver.org/collections/aster-l1t/items"
},
{
"rel": "parent",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "root",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "self",
"type": "application/json",
"href": "https://stacserver.org/collections/aster-l1t"
}
]
}
```
2 changes: 1 addition & 1 deletion overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ column is more of an example in some cases. OGC API makes some endpoint location
| `/api` | [OAFeat](ogcapi-features) | service-desc | OpenAPI 3.0 JSON | The OpenAPI definition of the endpoints in this service |
| **`/collections/{collectionId}`** | [OAFeat](ogcapi-features) | collection | Collection | Returns single Collection JSON |
| **`/collections/{collectionId}/items`** | [OAFeat](ogcapi-features) | items | ItemCollection | GeoJSON FeatureCollection-conformant entity of Item objects in collection |
| **`/collections/{collectionId}/items/{featureId}`** | [OAFeat](ogcapi-features) | Item | Returns single Item (GeoJSON Feature) | |
| **`/collections/{collectionId}/items/{featureId}`** | [OAFeat](ogcapi-features) | item | Returns single Item (GeoJSON Feature). This relation is defined by STAC, but its use is discouraged in STAC API, as Items should be referenced through their containing Collection rather than directly. | |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? That items should be referenced through their containing Collection? What's the reason to discourage this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it should be discouraged per se, you could have a browsable API that has both child catalogs (and ultimately items). Or like @fredliporace has implemented I think, where the whole catalog is a normal static catalog with only the /search endpoint being dynamic.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewhanson yes, the API includes a child link to the static catalog. Did this to list a single entry in stacindex, that references both the search endpoint and the static catalog.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. This should not be discouraged.
I think I'd say static catalogs should link to the API, too. And APIs should link to static catalogs, so that no matter where you start, you can find everything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote this in the README to be more clear -- I feel like I'm having a hard time expressing this well. please re-review.


## Conformance Classes

Expand Down