Skip to content

Commit

Permalink
feat: set exceededTransferLimit in metadata (#947)
Browse files Browse the repository at this point in the history
* feat: set exceededTransferLimit in metadata
  • Loading branch information
rgwozdz authored Mar 11, 2024
1 parent 7e24310 commit 95160a7
Show file tree
Hide file tree
Showing 16 changed files with 613 additions and 236 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-pets-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@koopjs/featureserver": patch
---

- allow exceededTransferLimit to be set by provider metadata
5 changes: 5 additions & 0 deletions .changeset/kind-students-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@koopjs/koop-core": minor
---

allow exceededTransferLimit in GeoServices output-plugin to be set by provider metadata
5 changes: 5 additions & 0 deletions .changeset/twenty-gifts-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@koopjs/winnow": major
---

- change collection.metadata.limitExceeded to collection.metadata.exceededTransferLimit
8 changes: 4 additions & 4 deletions packages/featureserver/coverage-unit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions packages/featureserver/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions packages/featureserver/src/query/render-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,24 @@ const featureResponseTemplate = {
* @param {object} params
* @return {object} formatted features data
*/
function renderFeaturesResponse(data = {}, params = {}) {
function renderFeaturesResponse(data, params) {
const template = _.cloneDeep(featureResponseTemplate);

const {
uniqueIdField: uniqueIdFieldDefault,
objectIdFieldName: objectIdFieldNameDefault,
} = template;

const { metadata: { limitExceeded, transform, idField, hasZ } = {} } = data;
const {
metadata: { exceededTransferLimit = false, transform, idField, hasZ } = {},
} = data;

const computedProperties = {
geometryType: params.geometryType,
spatialReference: getOutputSpatialReference(data, params),
fields: QueryFields.create({ ...data, ...params }),
features: data.features || [],
exceededTransferLimit: !!limitExceeded,
exceededTransferLimit,
objectIdFieldName: idField || objectIdFieldNameDefault,
uniqueIdField: {
...uniqueIdFieldDefault,
Expand Down
Loading

0 comments on commit 95160a7

Please sign in to comment.