Skip to content

Instantly share code, notes, and snippets.


Barnabas Kendall barnabas-avalara

View GitHub Profile
barnabas-avalara / kink-functions.js
Last active Nov 11, 2020
TurfJS kink functions
View kink-functions.js
import difference from '@turf/difference'
import { feature, multiPolygon, polygon, featureCollection, multiPoint } from '@turf/helpers'
import { getGeom } from '@turf/invariant'
import { flattenEach, featureEach } from '@turf/meta'
import simplepolygon from 'simplepolygon'
import gpsi from 'geojson-polygon-self-intersections'
export function unkinkPolygon (geojson) {
const features = []