mt-polygon-simplification/lib/turf-simplify/types.ts

12 lines
336 B
TypeScript
Raw Normal View History

2019-07-14 20:37:26 +02:00
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});