developmentseed / tipg

Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.
https://developmentseed.org/tipg/
MIT License
153 stars 23 forks source link

When Defining TIPG_MAX_FEATURES_PER_QUERY, the features limit is "less than" not "less than or equal to" #110

Closed aemonm closed 1 year ago

aemonm commented 1 year ago

It seems like the limit should be enforced as "less than or equal to" and not "less than"

For example, TIPG_MAX_FEATURES_PER_QUERY=50000 and a request of collections/public.slick_plus/items?limit=50000, returns the error: { "detail": [ { "loc": [ "query", "limit" ], "msg": "ensure this value is less than 50000", "type": "value_error.number.not_lt", "ctx": { "limit_value": 50000 } } ] } Possibly limit check is defined here: https://github.com/developmentseed/tipg/blob/be04e608dcaccd408e638845e117506a47f64fda/tipg/factory.py#L785

And this comment makes me think it should be treated as lte and not lt. https://github.com/developmentseed/tipg/blob/be04e608dcaccd408e638845e117506a47f64fda/tipg/collections.py#L751

vincentsarago commented 1 year ago

👍

The spec says:

If the server has any more results available than it returns (the number it returns is less than or equal to the requested/default/maximum limit) then the server will include a link to the next set of results.

so yes it should be le