koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
104 stars 32 forks source link

`exceededTransferLimit` is always false #62

Closed zbeat closed 6 years ago

zbeat commented 6 years ago

Related to https://github.com/koopjs/FeatureServer/pull/53/...

We have a pass-through Koop provider, with a maxRecordCount of 1000.

Unfortunately the Koop Feature Service is always showing exceededTransferLimit as false, even when the SCF API returns a total record count of 26,810 (e.g.). I've verified (via console logging) that geojson.metadata.limitExceeded is correcting being set to true inside our Koop provider.

Has anyone else had any problems like this?

dmfenton commented 6 years ago

Hey Zach, this is the relevant code:

https://github.com/koopjs/FeatureServer/blob/master/src/templates.js#L71

metadata.limitExceeded must be true and req.query.limit (default 2000) must be greater than or equal to metadata.maxRecordCount (default 2000)

can you confirm this is the case?

zbeat commented 6 years ago

@dmfenton Pardon delay, this slipped by me while I was on holiday.

Hey Zach, this is the relevant code: https://github.com/koopjs/FeatureServer/blob/master/src/templates.js#L71

FTR, I see that's now on line 73.

req.query.limit (default 2000) must be greater than or equal to metadata.maxRecordCount (default 2000)

Perhaps I've screwed something up, so here are a few observations about our Koop provider:

  1. It listens for req.query.resultRecordCount not req.query.limit.
  2. It sets metadata.maxRecordCount to 1000 (fixed), as that's the limit for our API.
  3. It sets metadata.limitExceeded to true when # of records in database exceeds API limit (> 1000).
dmfenton commented 6 years ago

Let's get on a screen share tomorrow and debug this together.

zbeat commented 6 years ago

Fixed in PR #79, released as 2.10.0. Thx @dmfenton! 🎉