Turf Versions Save

A modular geospatial engine written in JavaScript and TypeScript

v6.5.0

2 years ago

6.5.0

🏅 New Features/Enhancements

🐛 Bug Fixes

📖 Documentation

🔔 Misc

v3.0.11

7 years ago
  • removes vendored point-on-line implementation in favor of a local dependency
  • add test fixture for vertical linestrings passed to turf-line-slice

v3.0.4

7 years ago

v3.0.1

7 years ago

This is a big change in Turf! 3.0.0 is a release that targets the development cycle of Turf, letting us work on it more and release more often.

Monorepo

Turf 3.x and forward is a monorepo project. We publish lots of little modules as usual, but there's one repo - turfjs/turf - that contains all the code and the issues for the Turf source code. We use lerna to link these packages together and make sure they work.

Why? We already had internal turf modules, like turf-meta, and development was harder and harder - we had a bunch of custom scripts to do releases and tests, and these were just written for Turf. Lerna is from the very popular and very well-maintained babel project, and it works really well, and reduces maintainer sadness.

Simplicity

Turf grew a bunch of modules that weren't totally necessary, or were expressing only a line or two of JavaScript. We want to make things easier, but these modules didn't make code more expressive and they hid complexity where it didn't need to be hidden. Turf 3.x focuses on the core functionalities we need, making sure they're tested and performant.

Removed modules: merge, sum, min, max, average, median, variance, deviation, filter, remove, jenks, quantile. See the upgrade guide below for replacements.

Upgrading from v2

If you were using turf-merge

turf-merge repeatedly called turf-union on an array of polygons. Here's how to implement the same thing without the special module

var clone = require('clone');
var union = require('turf-union');
function merge(polygons) {
  var merged = clone(polygons.features[0]), features = polygons.features;
  for (var i = 0, len = features.length; i < len; i++) {
    var poly = features[i];
    if (poly.geometry) merged = union(merged, poly);
  }
  return merged;
}

If you were using turf-sum, min, max, average, median, variance, deviation

The turf-collect method provides the core of these statistical methods and lets you bring your own statistical library, like simple-statistics, science.js, or others.

If you were using turf-filter, turf-remove

These modules were thin wrappers around native JavaScript methods: use Array.filter instead:

var filteredFeatures = features.filter(function(feature) {
  return feature.properties.value > 10;
});

If you were using turf-jenks, turf-quantile

Use Array.map to get values, and then bring your own statistical calculation, like simple-statistics or science.js.

var values = features.map(function(feature) {
  return feature.properties.value;
});

v3.0.3

7 years ago

This publishes turf-collect, which was previously incorrectly named turf-aggregate

v2.0.0

9 years ago
  • turf-grid renamed turf-point-grid (turf.grid => turf.pointGrid)
  • turf-hex renamed turf-hex-grid (turf.hex => turf.hexGrid)
  • turf-hex-grid now has a required unit parameter
  • remove turf-isobands; use turf-isolines instead
  • added turf-square-grid (turf.squareGrid)
  • added turf-triangle-grid (turf.triangleGrid)
  • constrain turf-point-grid to the bbox

v1.4.0

9 years ago

1.4.0

  • update all module dependencies to master
  • add support for features in turf.intersection
  • fix issues with turf.polygon coordinate wrapping inconsistencies
  • add unit parameter to turf.concave

v1.3.5

9 years ago

harmonizes turf-tin dependency tree

v1.3.4

9 years ago
  • fix issue with turf-along

v1.3.3

9 years ago
  • added turf-line-slice for segmenting LineStrings with Points
  • turf-point-on-line for calculating the closest Point from a Point to a LineString