turf-go icon indicating copy to clipboard operation
turf-go copied to clipboard

A Go language port of Turf.js

:hammer: release GoDoc GitHub license Go Report Card Coverage Status

turf-go

A Go language port of Turfjs

Turf for Go

Turf for Go is a ported library in GoLang ported from the Turf.js library.

Extra modules

This version also include the clustering module that doesn't exist in the official turf library.

Ported functions

measurement

  • [x] along
  • [x] area
  • [x] bbox
  • [x] bboxPolygon
  • [x] bearing
  • [x] center
  • [ ] centerOfMass
  • [x] centroid
  • [x] destination
  • [x] distance
  • [x] envelope
  • [x] length
  • [x] midpoint
  • [ ] pointOnFeature
  • [ ] polygonTangents
  • [ ] pointToLineDistance
  • [x] rhumbBearing
  • [x] rhumbDestination
  • [x] rhumbDistance
  • [ ] square
  • [ ] greatCircle

clustering

  • [x] kmeans

Coordinate Mutation

  • [ ] cleanCoords
  • [ ] flip
  • [ ] rewind
  • [ ] round
  • [ ] truncate

Transformation

  • [ ] bboxClip
  • [ ] bezierSpline
  • [ ] buffer
  • [ ] circle
  • [ ] clone
  • [ ] concave
  • [ ] convex
  • [ ] difference
  • [ ] dissolve
  • [ ] intersect
  • [ ] lineOffset
  • [ ] simplify
  • [ ] tesselate
  • [ ] transformRotate
  • [ ] transformTranslate
  • [ ] transformScale
  • [ ] union
  • [ ] voronoi

Feature Conversion

  • [ ] combine
  • [ ] explode
  • [ ] flatten
  • [ ] lineToPolygon
  • [ ] polygonize
  • [ ] polygonToLine

Misc

  • [ ] kinks
  • [ ] lineArc
  • [ ] lineChunk
  • [ ] lineIntersect
  • [ ] lineOverlap
  • [ ] lineSegment
  • [ ] lineSlice
  • [ ] lineSliceAlong
  • [ ] lineSplit
  • [ ] mask
  • [ ] nearestPointOnLine
  • [ ] sector
  • [ ] shortestPath
  • [ ] unkinkPolygon

Helper

  • [x] featureCollection
  • [x] feature
  • [x] geometryCollection
  • [x] lineString
  • [x] multiLineString
  • [x] multiPoint
  • [x] multiPolygon
  • [x] point
  • [x] polygon

Random

  • [x] randomPosition
  • [x] randomPoint
  • [x] randomLineString
  • [x] randomPolygon

Data

  • [ ] sample

Joins

  • [x] pointsWithinPolygon
  • [ ] tag

Grids

  • [ ] hexGrid
  • [ ] pointGrid
  • [ ] squareGrid
  • [ ] triangleGrid

Classification

  • [x] nearestPoint

Aggregation

  • [ ] collect
  • [ ] clustersDbscan
  • [ ] clustersKmeans

Meta - Invariant

  • [x] coordAll
  • [x] coordEach
  • [ ] coordReduce
  • [ ] featureEach
  • [ ] featureReduce
  • [ ] flattenEach
  • [ ] flattenReduce
  • [x] getCoord
  • [x] getCoords
  • [x] getGeom
  • [x] getType
  • [ ] geomEach
  • [ ] geomReduce
  • [ ] propEach
  • [ ] propReduce
  • [ ] segmentEach
  • [ ] segmentReduce
  • [ ] getCluster
  • [ ] clusterEach
  • [ ] clusterReduce

Assertions

  • [ ] collectionOf
  • [ ] containsNumber
  • [ ] geojsonType
  • [ ] featureOf

Booleans

  • [ ] booleanClockwise
  • [ ] booleanContains
  • [ ] booleanCrosses
  • [ ] booleanDisjoint
  • [ ] booleanEqual
  • [ ] booleanOverlap
  • [ ] booleanParallel
  • [x] booleanPointInPolygon
  • [ ] booleanPointOnLine
  • [ ] booleanWithin

Unit Conversion

  • [x] bearingToAzimuth
  • [x] convertArea
  • [x] convertLength
  • [x] degreesToRadians
  • [x] lengthToRadians
  • [x] lengthToDegrees
  • [x] radiansToLength
  • [x] radiansToDegrees
  • [x] toMercator
  • [x] toWgs84

References:

https://github.com/mapbox/mapbox-java

https://github.com/Turfjs/turf