Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {multiPoint} from '@turf/helpers'
import cleanCoords from './'
// Fixtures
const multiPt = multiPoint([[0, 0], [0, 0], [2, 2]])
// Feature
cleanCoords(multiPt).geometry
cleanCoords(multiPt).properties
// Geometry
cleanCoords(multiPt.geometry).coordinates
cleanCoords(multiPt.geometry).type
// Input mutation
cleanCoords(multiPt.geometry, true)
} from '@turf/helpers'
import buffer from './'
// Standard Geometry
const pt = point([100, 0]);
const line = lineString([[100, 0], [50, 0]]);
const poly = polygon([[[100, 0], [50, 0], [0, 50], [100, 0]]]);
buffer(pt, 5);
buffer(line, 5);
buffer(poly, 5);
buffer(pt, 5, {units: 'miles'});
buffer(pt, 10, {units: 'meters', steps: 64});
// Multi Geometry
const multiPt = multiPoint([[100, 0], [0, 100]]);
const multiLine = multiLineString([[[100, 0], [50, 0]], [[100, 0], [50, 0]]]);
const multiPoly = multiPolygon([[[[100, 0], [50, 0], [0, 50], [100, 0]]], [[[100, 0], [50, 0], [0, 50], [100, 0]]]]);
buffer(multiPt, 5);
buffer(multiLine, 5);
buffer(multiPoly, 5);
// Collections
const fc = featureCollection([pt, line]);
const gc = geometryCollection([pt.geometry, line.geometry]);
buffer(fc, 5);
buffer(gc, 5);
// Mixed Collections
const fcMixed = featureCollection([pt, line, multiPt, multiLine]);
import {multiPoint, multiLineString, geometryCollection} from '@turf/helpers'
import * as flatten from './'
const multiPt = multiPoint([[0, 0], [10, 10]])
const multiLine = multiLineString([[[20, 20], [30, 30]], [[0, 0], [10, 10]]])
flatten(multiPt);
flatten(multiLine);
flatten(multiPt.geometry);
flatten(multiLine.geometry);
flatten(geometryCollection([multiPt.geometry, multiLine.geometry]));
toMultiPoint() {
return multiPoint(this.edges.map(edge => edge.from.coordinates));
}
EdgeRing.prototype.toMultiPoint = function toMultiPoint () {
return multiPoint(this.edges.map(function (edge) { return edge.from.coordinates; }));
};