If you are upgrading from the legacy terraformer package, you no longer need to instantiate Terraformer.Primitive objects to perform spatial operations. Instead, you work directly with raw GeoJSON objects using functions imported from @terraformer/spatial.
# Old way
npm install terraformer
# New way
npm install @terraformer/spatial
// Old way
const Terraformer = require('terraformer')
const polygon = new Terraformer.Primitive({
type: "LineString",
coordinates: [[ 100, 0 ], [ -45, 122 ], [ 80, -60 ]]
})
polygon.convexHull()
// New way
import { convexHull } from '@terraformer/spatial'
convexHull({
type: "LineString",
coordinates: [[ 100, 0 ], [ -45, 122 ], [ 80, -60 ]]
})