turf.kt is a multi-platform Kotlin library for spatial analysis based on Turf .
turf.kt uses GeoJSON data classes provided by the geojson.kt project. turf.kt expects the data to be standard WGS84 longitude, latitude coordinates. Check out geojson.io for a tool to easily create this data.
The list below outlines the Turf functions which currently exist within turf.kt:
- along
- area
- bbox
- bboxPolygon ->
BBox:toPolygon
- bearing
- center
- centerOfMass
- centroid
- destination
- distance
- envelope
- length
- midpoint
- pointOnFeature
- polygonTangents
- pointToLineDistance
- rhumbBearing
- rhumbDestination
- rhumbDistance
- square
- greatCircle
- cleanCoords ->
clean
- flip
- rewind
-
roundUse Kotlin'sround
- truncate
- bboxClip
- bezierSpline
- buffer
- circle
- clone Use
copy
- concave
- convex
- difference
- dissolve
- intersect
- lineOffset
- simplify
- tesselate
- transformRotate
- transformTranslate
- transformScale
- union
- voronoi
- combine
- explode
- flatten
- lineToPolygon
- polygonize
- polygonToLine
- kinks
- lineArc ->
arc
- lineChunk
- lineIntersect
- lineOverlap
- lineSegment ->
segment
- lineSlice
- lineSliceAlong
- lineSplit
- mask
- nearestPointOnLine
- sector
- shortestPath
- unkinkPolygon
See geojson.kt.
- randomPosition
- randomPoint
- randomLineString
- randomPolygon
- sample
- interpolate
- isobands
- isolines
- planepoint
- tin
- pointsWithinPolygon
- tag
- hexGrid
- pointGrid
- squareGrid
- triangleGrid
- nearestPoint
- collect
- clustersDbScan
- clustersKMeans
- coordAll
- coordEach
- coordReduce
- featureEach
- featureReduce
- flattenEach
- flattenReduce
-
getCoord - getCoords
-
getGeom -
getType - geomEach
-
geomReduce - propEach
- propReduce
- segmentEach
- segmentReduce
- getCluster
- clusterEach
- clusterReduce
See geojson.kt
- booleanClockwise ->
isClockwise()
/isCounterClockwise()
- booleanContains
- booleanCrosses
- booleanDisjoint
- booleanEqual ->
==
,!=
- booleanOverlap
- booleanParallel
- booleanPointInPolygon
- booleanPointOnLine
- booleanWithin
- bearingToAzimuth
- convertArea
- convertLength
- degreesToRadians ->
Double.toRadians()
- lengthToRadians
- lengthToDegrees
- radiansToLength
- radiansToDegrees ->
Double.toDegrees()
- toMercator
- toWgs84