Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

joeyklee/turfjs-as-a-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turfjs as a service

Node/Express API to run Turfjs on Glitch

Work in progress

API

Base URL: https://joeyklee-turfjs-as-a-service.glitch.me/

POST: /api/v1/turf/collect

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

Examples

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:

POST: /api/v1/turf/buffer

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

Examples

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

About

Node/Express API to run Turfjs on Glitch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published