opengeospatial / opengeospatial/ogcapi-features

Dynamically fetching features from more than one collection at a time

Open
#170 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Part 10: Query (was: Search)
Dominant language
CSS
Stars
386
Forks
92
Avg merge
3d 4h
Merged PRs (30d)
15

Description

This issues was raised in the OGC Vector Tiles pilot (VTPILOT).
Right now, WFS 3.0 only allows queries on a single feature collection at a time and does not provide a mechanism for fetching features from multiple collections in a single request (like the previous version of WFS allowed). Thus, in the context of the VTPILOT, one cannot request a Mapbox vector tile into which features of multiple types have been rendered.
One approach that has been mentioned ... since WFS 3.0 is schema-less, a server can offer a collection that is the aggregate of any number of feature types. The example given in the context of the VTPILOT was that a server could offer a "daraa" collection that is the combination of the collections currently offered individually (TRANSGROUNDCRV, AGRICULTURESRF, HYDROGRAPHYCRV, MLITARYSRF, etc.). The problem with this approach is that it is not dynamic. There is no way for a provider to anticipate which features types a user might want to fetch simultaneously.
Some work was done in the TB14 next gen thread to investigate this issues.

Approach 1:
Have a /items path that is the virtual aggregate of all the other collections that the server offers and then have a "collectionIds" parameter to allow the user to select which features types should be included in the response (e.g. .../items?f=json&collectionIds=TRANSGROUNDPNT,TRANSGROUNDCRV,TRANSGROUNDSRF&...)

Approach 2:
Support the POST method on the /collections path to allow new collections to be created by aggregating existing collections. So, using the VTPILOT collections as an example, one could do the following:

POST /collections
{
"name": "daraa",
"title": "Daraa Transportation Infrastructure",
"description": "An aggregate collection of the transportation features in the Daraa data set.",
"links": [
{ "href": "http://data.example.org/collections/daraa/items",
"rel": "item", "type": "application/geo+json",
"title": "Daraa Transporation Infrastructure" },
{ "href": "http://data.example.org/collections/daraa/items",
"rel": "item", "type": "application/gml+xml; version=3.2; profile=http://www.opengis.net/def/profile/ogc/2.0/gml-sf0",
"title": "Daraa Transportation Infrastucture" }
],
"collections": [TRANSGROUNDPNT,TRANSGROUNDCRV,TRANSGROUNDSRF]
}

The POST body is basically the same as the schema for the metadata about a feature collection with the addition of the "collections" array which lists existing collection names to be "aggregated" under this new collection. Once created, the new "daraa" collection can be queried like any other collection. DELETE can be used to drop it. The OPTIONS method can be used to figure out if the POST and DELETE methods are supported on the /collection resource.
Hmm, I wonder if this can be considered a dynamic "hierarchy" or "theme" mechanism? ... since I suppose I could create a another collection named "Syria" that aggregates all the Syrian data, etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the TB14 next gen thread referenced in the issue and compare the two proposed approaches for querying multiple feature collections. Done means agreeing on a supported mechanism and defining its API behavior, including how collections are selected or created and how supported methods are exposed.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.