Package-level declarations

Functions

Link copied to clipboard
fun along(line: LineString, distance: Double, units: Units = Units.Kilometers): Position

Takes a LineString and returns a position at a specified distance along the line.

Link copied to clipboard
fun area(geometry: Geometry): Double

Takes a geometry and returns its area in square meters.

Link copied to clipboard
fun bbox(featureCollection: FeatureCollection): BoundingBox

Takes a feature collection and calculates a bbox that covers all features in the collection.

Takes a feature and calculates the bbox of the feature's geometry, and returns a bounding box.

fun bbox(geometry: Geometry): BoundingBox
fun bbox(geometry: LineString): BoundingBox
fun bbox(geometry: MultiPoint): BoundingBox
fun bbox(geometry: MultiPolygon): BoundingBox
fun bbox(geometry: Point): BoundingBox
fun bbox(geometry: Polygon): BoundingBox

Takes a geometry and calculates the bbox of all input features, and returns a bounding box.

Link copied to clipboard

Takes a bbox and returns an equivalent Polygon.

Link copied to clipboard
fun bearing(start: Position, end: Position, final: Boolean = false): Double

Takes two positions (start, end) and finds the geographic bearing between them, i.e. the angle measured in degrees from the north line (0 degrees)

Link copied to clipboard
fun center(feature: Feature<*>): Point

Takes any kind of Feature and returns the center point. It will create a BoundingBox around the given Feature and calculates the center point of it.

fun center(geometry: Geometry): Point

It overloads the center(feature: Feature) method.

Link copied to clipboard
fun centroid(geometry: Geometry): Point

Computes the centroid as the mean of all vertices within the object.

Link copied to clipboard
fun computeBbox(coordinates: List<Position>): BoundingBox
Link copied to clipboard
fun destination(origin: Position, distance: Double, bearing: Double, units: Units = Units.Kilometers): Position

Takes a position and calculates the location of a destination position given a distance in degrees, radians, miles, or kilometers; and bearing in degrees. This uses the Haversine formula to account for global curvature.

Link copied to clipboard
fun distance(from: Position, to: Position, units: Units = Units.Kilometers): Double

Calculates the distance between two positions. This uses the Haversine formula to account for global curvature.

Link copied to clipboard
fun envelope(geoJson: GeoJson): Polygon

Takes any GeoJson and returns a rectangular Polygon that encompasses all vertices.

Link copied to clipboard
fun greatCircle(start: Position, end: Position, pointCount: Int = 100, antimeridianOffset: Double = 10.0): Geometry

Calculate great circles routes as LineString. Raises error when start and end are antipodes.

Link copied to clipboard
fun length(lineString: LineString, units: Units): Double

Calculates the length of the given LineString in the given Units.

fun length(multiLineString: MultiLineString, units: Units): Double

Calculates the combined length of all LineStrings from the given MultiLineString in the given Units.

fun length(multiPolygon: MultiPolygon, units: Units): Double

Calculates the combined length of perimeter the Polygons in the MultiPolygon in the given Units. Any holes in the polygons will be included in the length.

fun length(polygon: Polygon, units: Units): Double

Calculates the length of perimeter the given Polygon in the given Units. Any holes in the polygon will be included in the length.

Link copied to clipboard
fun midpoint(point1: Position, point2: Position): Position

Takes two Positions and returns a point midway between them. The midpoint is calculated geodesically, meaning the curvature of the earth is taken into account.

Link copied to clipboard
fun rhumbBearing(start: Position, end: Position, isFinal: Boolean = false): Double

Takes two positions and finds the bearing angle between them along a Rhumb line i.e. the angle measured in degrees start the north line (0 degrees)

Link copied to clipboard
fun rhumbDestination(origin: Position, distance: Double, bearing: Double, units: Units = Units.Kilometers): Position

Returns the destination Point having travelled the given distance along a Rhumb line from the origin Position with the (variant) given bearing.

Link copied to clipboard
fun rhumbDistance(from: Position, to: Position, units: Units = Units.Kilometers): Double

Calculates the distance along a rhumb line between two points in degrees, radians, miles, or kilometers.

Link copied to clipboard
fun square(boundingBox: BoundingBox): BoundingBox

Takes a bounding box and calculates the minimum square bounding box that would contain the input.

Link copied to clipboard