Closed efbenson closed 4 years ago
You can try v3.17.0 for the new provider options now:
before
for the request parameter pre-processingafter
for the request response post-process// supply the options when registering the provider
koop.register(myProvider, {
before: (req, callback) => {
// do something with the req
callback()
},
after: (req, data, callback) => {
// tranform the data
callback(null, data)
}
})
See #98 for more details.
It would be nice to not have to fork a provider if you wanted to append or transform data. For example, if my provider is the AGOL provider and I want to take a layer's results from AGOL on the fly and enrich the data (change some values or add additional fields) it would nice to have a place in the koop layer that exposes the results of the provider with a way for you to mutate it before its sent out vs having to extend the provider for every use case.
Ideally there would be an option for the winnow query to be run against the transformed dataset to apply the query against the transformed data (to filter it further)