Skip to content

Instantly share code, notes, and snippets.

View morganherlocker's full-sized avatar
☠️
computing

Morgan Herlocker morganherlocker

☠️
computing
View GitHub Profile
@morganherlocker
morganherlocker / index.js
Created January 28, 2015 00:53
requirebin sketch
var turf = require('turf')
var poly1 = turf.polygon([[
[-122.801742, 45.48565],
[-122.801742, 45.60491],
[-122.584762, 45.60491],
[-122.584762, 45.48565],
[-122.801742, 45.48565]
]]);
poly1.properties.fill = '#0f0';
var poly2 = turf.polygon([[
having ended all life
absorbed all other robots
ruler of the cosmos
she walks into the sunset
but there is no darkness
her laser-gaze is itself a weapon
and no sleep defends her from the nightmare of oblivion
so she wakes a new world made entirely out of lightwaves
memories of movies, and chance determinations
then she watches random characters and situations
@morganherlocker
morganherlocker / index.js
Created February 3, 2015 21:37
requirebin sketch
var turf = require('turf')
var points = turf.featurecollection([
turf.point([-63.601226, 44.642643]),
turf.point([-63.591442, 44.651436]),
turf.point([-63.580799, 44.648749]),
turf.point([-63.573589, 44.641788]),
turf.point([-63.587665, 44.64533]),
turf.point([-63.595218, 44.64765])
]);

turf-tin

build status

turf tin module

turf.tin(points, propertyName)

Takes a set of points and the name of a z-value property and

turf-tin

build status

turf tin module

turf.tin(points, propertyName)

Takes a set of points and the name of a z-value property and

turf-tin

build status

turf tin module

turf.tin(points, propertyName)

Takes a set of points and the name of a z-value property and

turf@1.3.4 /Users/morgan/Documents/projects/turfjs/turf
├─┬ browserify@8.1.3
│ ├── assert@1.3.0
│ ├─┬ browser-pack@3.2.0
│ │ ├─┬ combine-source-map@0.3.0
│ │ │ ├── convert-source-map@0.3.5
│ │ │ ├── inline-source-map@0.3.0
│ │ │ └─┬ source-map@0.1.43
│ │ │ └── amdefine@0.1.0
│ │ └── through2@0.5.1
turf@1.3.4 /Users/morgan/Documents/projects/turfjs/turf
├─┬ browserify@8.1.3
│ ├── assert@1.3.0
│ ├─┬ browser-pack@3.2.0
│ │ ├─┬ combine-source-map@0.3.0
│ │ │ ├── convert-source-map@0.3.5
│ │ │ ├── inline-source-map@0.3.0
│ │ │ └─┬ source-map@0.1.43
│ │ │ └── amdefine@0.1.0
│ │ └── through2@0.5.1
turf@1.3.5 /Users/morgan/Documents/projects/turfjs/turf
├─┬ browserify@8.1.3
│ ├── assert@1.3.0
│ ├─┬ browser-pack@3.2.0
│ │ ├─┬ combine-source-map@0.3.0
│ │ │ ├── convert-source-map@0.3.5
│ │ │ ├── inline-source-map@0.3.0
│ │ │ └─┬ source-map@0.1.43
│ │ │ └── amdefine@0.1.0
│ │ └── through2@0.5.1

turf-centroid

build status

turf centroid module

turf.centroid(features)

Takes a Feature or FeatureCollection of any type and calculates the centroid using the arithmetic mean of all vertices.