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

Pagination (limit parameter) for collections? #87

Closed
m-mohr opened this issue Jan 17, 2020 · 10 comments
Closed

Pagination (limit parameter) for collections? #87

m-mohr opened this issue Jan 17, 2020 · 10 comments
Labels
Close Collections Applicable to Collections (consider to use Part 2 instead)

Comments

@m-mohr
Copy link

m-mohr commented Jan 17, 2020

OGC API - Features specifies a limit parameter for items. There's no limit / pagination for collections though. We have some cases with hundreds of collections so would it make sense to add an optional limit parameter for pagination of collections?

@bradh
Copy link
Contributor

bradh commented Jan 20, 2020

This seemed like a reasonable request on first pass, but maybe we don't need it. I don't know of anyone who paginated "GetCapabilities" responses, and this is (conceptually) a subset of what we would have returned in that kind of document.

Is there ever a case where you wouldn't want all of the collections? If you're always going to iterate to end, then pagination only makes sense if the response it too large to handle in one hit. I don't see that as the case for less than at least (rough order) thousands of collections, even on a web client.

@m-mohr Any feel for rough size of the JSON for your cases?

@cportele
Copy link
Member

In general, such an option could be useful, but it has to be a separate conformance class and should be in a future part of Common (not part 1).

@m-mohr
Copy link
Author

m-mohr commented Jan 20, 2020

@bradh At the moment often between 1 to 10 megabytes.

@cportele Why?

@cportele
Copy link
Member

@m-mohr - In my view, part 1 should only contain the requirements that most implementations will need and this is not one of them. This was also discussed in the Features/STAC sprint in March 2018. See opengeospatial/ogcapi-features#76.

@dblodgett-usgs
Copy link

I agree with @cportele that this would be in a separate conformance class and not in core.

I would also like to advocate for this sort of general utility. I have experienced getCapabilities documents that got completely out of hand -- particularly in SOS where the offering list was tens of thousands of sensors. Looking forward to features use cases concerning citizen science, or extensions that push things like monitoring stations up to the collections level, I could imagine collections being something that could proliferate rapidly.

That said, we may want to make an architectural decision about collections now that says use cases in which this would occur are best implemented as collections of collections such that the thing that would proliferate would be encapsulated in something that could be grokked at the top level by a human without a need to do any filtering?

@bradh
Copy link
Contributor

bradh commented Jan 20, 2020

As an alternative, perhaps there should be a simpler way to get the list, and a more detailed description if you need it.

I'm concerned that hundreds of collections turns into megabytes of JSON though. I don't think consumers should be seeing 10K text per collection. If we're going to show it to the user, we need to be realistic about what we're exporting.

@cmheazel
Copy link
Contributor

The CollectionInfo (or Collection in Features) entity includes an extent. It would be logical to extend the scope of the limit, bbox, and datetime parameters to include CollectionInfo as well. So my suggestion is to bring the limit, bbox, and datetime parameters into Common as a new conformance class with the scope of collections, collectionInfo, and items.

@bradh
Copy link
Contributor

bradh commented Jan 25, 2020

@cmheazel Is this comment about extents related to pagination, or was it intended for another issue?

@cmheazel
Copy link
Contributor

API-Common:Collections supports use of the limit parameter on the /collections path. This will limit the number of collections included in the /collections response. So an API with a large number of collections can return the information about those collections as a set of pages of size specified by the limit parameter and accessed by the "next" link.

@cmheazel cmheazel added the Collections Applicable to Collections (consider to use Part 2 instead) label May 11, 2020
@m-mohr
Copy link
Author

m-mohr commented May 11, 2020

Yes, it's in the spec now. Can be closed from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close Collections Applicable to Collections (consider to use Part 2 instead)
Projects
Development

No branches or pull requests

5 participants