koopjs / koop-provider-geojson

GeoJSON provider for Koop
Other
6 stars 5 forks source link
koop-provider

Koop geojson Provider

This is a geojson that demonstrates how to build a Koop Provider. Full documentation is provided here.

/geojson/{url|pipe|path}/FeatureServer/0/query

where the URL changes / to | for including in the url. e.g.

example.com%7Cshares%7C6de6fe4ccdea85b8.geojson

To try this out, here are few example services:

If you want to write your own provider, simply fork this repository or copy the contents.

Files

File Description
index.js Mandatory Configures provider for usage by Koop
model.js Mandatory Translates remote API to GeoJSON
routes.js Optional Specifies additional routes to be handled by this provider
controller.js Optional Handles additional routes specified in routes.js
server.js Optional Reference implementation for the provider
test/model-test.js Optional tests the getData function on the model
test/fixtures/input.json Optional a geojson of the raw input from the 3rd party API
config/default.json Optional used for advanced configuration, usually API keys.

Test it out

Run server:

Example API Query:

Tests:

With Docker

Publish to npm