koop-geojson-file
GeoJSON file provider for Koop
Based on code from koop-sample-provider
Usage
For information on using Koop, see https://github.com/esri/koop
Install dependencies:
npm install koop koop-geojson-file express ejs
Make sure your config
contains a geojsonFiles
key that holds an array of objects with name
and path
properties for each GeoJSON file you'd like to serve as a FeatureService. See example code below:
var config = "server": "port": 1337 "geojsonFiles": "name": "test-name" "path": "/data/test-file.geojson" "name": "other-name" "path": "/data/other-file.geojson" ; var koop = config;var koopGeoJson = ; koop; var express = ;var app = ; app; app;
koop-geojson-file uses the name
property of the objects in geojsonFiles
to route. For example, with the geojsonFiles
as defined in the above example, routes to FeatureServices would be:
- http://localhost:1337/geojson/test-name/FeatureServer
- http://localhost:1337/geojson/test-name/FeatureServer/0
- http://localhost:1337/geojson/other-name/FeatureServer
- http://localhost:1337/geojson/other-name/FeatureServer/0
Developing
git clone https://github.com/jseppi/koop-geojson-file.gitcd koop-geojson-filenpm installnpm test