mt-polygon-simplification/lib/turf-simplify/types.ts
2019-07-14 20:37:26 +02:00

12 lines
336 B
TypeScript

import {polygon, Feature, Polygon} from '@turf/helpers'
import simplify from './'
const poly = polygon([[[0, 0], [10, 10], [20, 20], [0, 0]]]);
// Output type is the same as Input type
const simple: Feature<Polygon> = simplify(poly);
// Extra params
simplify(poly, {tolerance: 1});
simplify(poly, {tolerance: 1, highQuality: true});