Skip to content
Matthew McKenna edited this page Jul 1, 2014 · 3 revisions

Turf: A Modular GIS engine written in JavaScript

Turf is a modular collection of GIS functionalities which can be accessed as individual node modules using require('turf-distance') or as scripts run in the client. All of the turf features are also bundled in https://github.com/Turfjs/turf.

Each turf module has a readme.md file which explains it's general functionality and has an example of it being applied in a node.js context.

Getting Started

See the turf.js repo of all the consolidated modules to get a brief intro to installing turf with npm. Because turf was created as a collection of node modules it may help to get a little more learned as to node and javascript with node school. Though you certainly don't need to be a node.js expert to use turf.

Examples

Each turf 'feature' has a readme.md with a bit of documentation as to how the module works and what it does. There is also at least one test of the module usually in a test.js file which may be in a test directory or may be in the main directory.

For an example of text.js in main directory see: turf-remove's test file

For modules for which datasets not included in the test.js were helpful for testing there is very possibly a test directory. See: turf-doughnuts test file

Using turf in the client

Clientside turf is now easy w/ turf.min.js but browserify works with any module or collection of them if you don't desire all the turf features). And in the short term future every module may be created with its own minified code runnable in the browser.

This will be a link to wiki page of describing how to use turf.min.js in a little webmap.

Clone this wiki locally