Skip to content
Matthew McKenna edited this page Jul 3, 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.

There are currently 51 turf modules! All of them with passing tests except turf-combine.

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

Contributing

Contributions to turf.js are more than welcome. Check out contributing guidelines for an overview of how you can help. Also help make this wiki or the wikis for all the turf modules amazing.

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.

See: Client side turf howto