Skip to content

Make uri and serialized_query_parameters available to providers in itemtypes? #2055

Open
@mikemahoney218-usgs

Description

@mikemahoney218-usgs

Is your feature request related to a problem? Please describe.

Related to #1981 , we've been working to move away from limit-offset paging for our Postgres provider, as deep pages using large offsets are inefficient and can cause users to download duplicate records if earlier pages have been updated during a query. In #1982 , we altered itemtypes so that "next" links could be returned by a provider without pygeoapi then appending its own offset-based next links to the response.

The thing we missed was that pygeoapi uses uri and serialized_query_params to generate the next_href object, and these objects aren't available from inside a provider:

next_href = f'{uri}?offset={next_}{serialized_query_params}'

This makes it challenging to generate next links inside a provider.

Describe the solution you'd like

We'd like uri and serialized_query_params to be passed to providers to be used to generate next links if desired.

Describe alternatives you've considered

We could alternatively have some way in itemtypes to pass our "page key" from the provider and have itemtypes use that to generate the link. If offset wasn't validated to be numeric, we'd just need some way for the provider to control next_ here:

next_href = f'{uri}?offset={next_}{serialized_query_params}'

I think that approach is a bit less friendly than letting giving the provider these objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions