Node/Express API to run Turfjs on Glitch
Work in progress
Base URL: https://joeyklee-turfjs-as-a-service.glitch.me/
Send JSON with the following:
{
"inPoints": <GeoJSON Feature Collection of Points | URL to GeoJSON>,
"inPolygons": <GeoJSON Feature Collection of Polygons | URL to GeoJSON>,
"inProperty":<String - property name in your inPoints>,
"outProperty": <String - property name of the array of collected data to be added to your inPolygons>
}
To:
https://joeyklee-turfjs-as-a-service.glitch.me/api/v1/turf/collect
In the commandline:
curl -X POST --header "Content-Type: application/json" -d '{"inPoints":"https://cdn.jsdelivr.net/gh/joeyklee/turfjs-as-a-service@master/examples/data/point-nyc.geojson","inPolygons": "https://cdn.jsdelivr.net/gh/joeyklee/turfjs-as-a-service@master/examples/data/polygon-nyc.geojson","inProperty":"counts", "outProperty": "joined"}' http://localhost:3000/api/v1/turf/collect
In the browser:
Send JSON with the following:
{
"geojson": <GeoJSON Feature Collection | URL to GeoJSON>,
"radius": <Number>,
"options":<Object> {
units: <String - (meters, kilometers(default), feet, miles)>,
steps: <Number - how much resolution your circle should have (default: 60)>
}
}
To:
https://joeyklee-turfjs-as-a-service.glitch.me/api/v1/turf/buffer
In the commandline:
curl -X POST --header "Content-Type: application/json" -d '{"geojson":"https://cdn.jsdelivr.net/gh/joeyklee/turfjs-as-a-service@master/examples/data/point-nyc.geojson", "radius":500, "options":{ "units":"meters", "steps": 32}}' http://localhost:3000/api/v1/turf/buffer