ogcapi-features icon indicating copy to clipboard operation
ogcapi-features copied to clipboard

Dynamically fetching features from multiple collections in a single request.

Open pvretano opened this issue 7 years ago • 10 comments

One thing that came up recently was a question about how to dynamically fetch features from multiple feature types in a single request similar to the capability supported by WFS 2.X. A WFS 3.0 provider can, of course, organize their collections any way they like but cannot typically anticipate which combinations of feature type a client might want. My thinking was to define a /collection/items path (or a /items path might be better to avoid name collisions) that has all the usual parameters and a "collectionIds" parameter to accept a list of collection ids to query. Of course the filtering would need to be carefully handled. Only properties (if any) common to all feature types could be filtered. This could also be handled in a "complex query" extension but this is not really a complex query. It is more of an aggregation query ... a convenience I guess to reduce the number of calls a client needs to make to the server. Comments?

pvretano avatar Aug 23 '18 16:08 pvretano

From the two options I would prefer /items over /collections/items.

One problem with /items is that you do not have any metadata like the CRSs or the spatial extent that you can query. Would a predefined "virtual" collection (we would need to reserve the name in the Core) work? Something like /collections/all/items. I have not really thought this through, just an idea.

cportele avatar Aug 23 '18 16:08 cportele

I prefer /collection/items for exactly the reason you give (i.e. the metadata). However, a reserved collection name such as "all" might be a better approach.

pvretano avatar Aug 23 '18 16:08 pvretano

I definitely would prefer virtual collections that require some description of what they can handle to an endpoint that takes collectionIds parameter.

I do think an /all endpoint could make sense to add a collectionIds parameter.

But in general lots of links are good, that describe things in different ways. So enable more endpoints that can aggregate other collections. And then describe in each the capabilities in each.

So I can like have /collections/spatiotemporal/ or /collections/satellite-imagery/ - and each could report the collectionIds that it queries, as well as the fields / schema validation of the items it contains.

Perhaps we get to a set of recommendations on how to make a 'grouping'. I could see /collections/landsat8 also linking to the 2 collections above to indicate that it is a member of those more widely defined types.

cholmes avatar Aug 23 '18 16:08 cholmes

In general I think that WFS 3.0 already supports the idea of statically predefined aggregates of collections. There are no restrictions on how collections are organized. So a WFS can offer collection A, collection B and collection C where collection C is actually an aggregate of A & B. The only deficiency is that there is no formal mechanism to explicitly advertise the fact that C is actually an aggregate of A & B. A provider would need to indicate that information in one of the descriptive text fields (e.g. description) in the metadata for collection C.

It's the dynamic, on-the-fly case that is not covered and so /collections/all with a collectionIds parameter satisfies that use case.

pvretano avatar Aug 23 '18 17:08 pvretano

Cool. I think it'd be a nice little construct for how to advertise the collectionId's that a certain collection may represent. That is not just 'description', but is actually a list of those collectionId's. And then 'all' would use that same mechanism, but would list every collection id that is available.

We are thinking this would be an extension, yeah? I think it'd be a burden for many to offer full cross collection search.

cholmes avatar Aug 23 '18 18:08 cholmes

I am not sure what the others think but I would not be opposed to adding a formal mechanism to the collection metadata in the core for advertising a list of aggregated collections should a service want to offer statically aggregated collections. Dynamic aggregation is, in my opinion, definitely an extension.

pvretano avatar Aug 23 '18 19:08 pvretano

+1

cportele avatar Aug 24 '18 07:08 cportele

20-MAY-2019 Conference call: This is something for the hackathon to see the perspective of others.

cportele avatar May 20 '19 14:05 cportele

Decision that this is a capability that will be specified in an extension.

cportele avatar Jun 25 '19 10:06 cportele

In discussions with OAF and STAC participants during the sprint in Arlington we agreed that /search makes most sense for us as /items would conflict with other use cases.

Here's the PR for STAC to rename /stac/search to /search as a first attempt to align with efforts of OAF: https://github.com/radiantearth/stac-spec/pull/632

m-mohr avatar Nov 06 '19 16:11 m-mohr