How to use the @turf/helpers.multiPoint function in @turf/helpers

To help you get started, we’ve selected a few @turf/helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Turfjs / turf / packages / turf-clean-coords / types.ts View on Github external
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)
github Turfjs / turf / packages / turf-buffer / types.ts View on Github external
} 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]);
github Turfjs / turf / packages / turf-flatten / types.ts View on Github external
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]));
github Turfjs / turf / packages / turf-polygonize / lib / EdgeRing.js View on Github external
toMultiPoint() {
        return multiPoint(this.edges.map(edge => edge.from.coordinates));
    }
github Turfjs / turf / packages / turf-polygonize / lib / polygonize.js View on Github external
EdgeRing.prototype.toMultiPoint = function toMultiPoint () {
    return multiPoint(this.edges.map(function (edge) { return edge.from.coordinates; }));
};