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

enhance support for limits (RFC5) #1856

Open
tomkralidis opened this issue Nov 20, 2024 · 2 comments
Open

enhance support for limits (RFC5) #1856

tomkralidis opened this issue Nov 20, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@tomkralidis
Copy link
Member

Provide enhanced limit handling implementation in support of better definition and control on data query limiting.

RFC5 can be found at https://pygeoapi.io/development/rfc/5.

@tomkralidis tomkralidis added the enhancement New feature or request label Nov 20, 2024
@tomkralidis tomkralidis added this to the 0.20.0 milestone Nov 20, 2024
@tomkralidis tomkralidis self-assigned this Nov 20, 2024
@webb-ben
Copy link
Member

webb-ben commented Jan 15, 2025

@Youssef-Harby @tomkralidis bringing part of the conversation about "unlimited" defaultitems configuration in pygeoapi. Given the relative heterogeneity of providers, I wonder if it possible to realistically implement that on a provider level. At least I wonder if the most effective implementation would leverage the hits response and then querying by the literal limit. For various systems that interact with pygeoapi, this is generally the behavior I do to get "all" the items returned. See
https://github.com/cgs-earth/pygeoapi-plugins/blob/dc7fb55a2126c6a178c71e2097f1066ba35fd12b/pygeoapi_plugins/process/intersect.py#L192-L193

Is there a way to do this without consistently making two queries on a provider, first effectively getting resulttype=hits and then second with that value? Is there a naive way to pass python infinity to providers?

@webb-ben
Copy link
Member

Interestingly, if we changed https://github.com/geopython/pygeoapi/blob/master/pygeoapi/util.py#L147 to

        if '.' in value or 'inf' in value:  # float?

you could get pygeoapi to cast the configured defaultlimit to pythonic infinity, and it works for at least some of the providers. At the moment this is only possible if you set this as an environment variable, but its not that far off.

    limits:
        default_items: ${PYGEOAPI_SERVER_DEAULT_LIMIT:-inf}
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment