koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
654 stars 125 forks source link

allow supportedQueryFormats override from metadata #935

Closed rgwozdz closed 4 months ago

rgwozdz commented 4 months ago

The GeoServices output now delivers layer metadata with the supportedQueryFormats field assigned a value of 'JSON,geojson,PBF'.
When PBF is one of the supportedQueryFormats listed in layer metadata, many ArcGIS Clients will preferentially make query request with pbf as the desired format. This is great because PBF is more compact, but some developers may want to force the use of JSON format by said clients (e.g., it might help in debugging). This PR allows provider developers to override the default value of supportedQueryFormats, by adding their own key-value entry to the metadata object found on the geojson generated by a provider. For example

const geojson = {
  type: 'FeatureCollection',
  features: []
  metadata: {
    supportedQueryFormats: 'JSON'
  }
} ;

This pattern would ensure that the layer-metadata would only list 'JSON' as the supported query format. So clients would then request in format JSON as opposed to PBF.

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: c61b9adcf2da150d74e7c812fd25755560bb732d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | -------------------------- | ----- | | @koopjs/featureserver | Minor | | @koopjs/output-geoservices | Patch | | @koopjs/koop-core | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 4 months ago

Coverage Report (change vs master)

File Path Statements Branches Functions Lines
packages/featureserver/src/helpers/table-layer-metadata.js 98.7 yellowGreen vs 98.27 yellowGreen 89.79 yellow vs 79.54 orange 100 green vs 100 green 98.68 yellowGreen vs 98.27 yellowGreen