Package-level declarations

GeoJSON feature conversion utilities including combine, explode, and geometry/property mapping.

Functions

Link copied to clipboard
Link copied to clipboard

Returns a FeatureCollection by applying mapGeometry to each feature in this collection.

fun <G1 : Geometry?, G2 : Geometry?, P> Feature<G1, P>.mapGeometry(transform: (G1) -> G2): Feature<G2, P>

Returns a Feature containing a Geometry by applying the given transform function to the original geometry. The original feature's properties are preserved in the result.

Link copied to clipboard

Transforms the properties of all features in a FeatureCollection using the provided transform function.

fun <G : Geometry?, P1, P2> Feature<G, P1>.mapProperties(transform: (P1) -> P2): Feature<G, P2>

Transforms the properties of a Feature using the provided transform function.

Link copied to clipboard

Converts a GeometryCollection to a FeatureCollection by wrapping each geometry in a feature.

Link copied to clipboard

Converts a FeatureCollection to a GeometryCollection by extracting all geometries from the features.

Link copied to clipboard

Converts a LineString to a MultiLineString containing the single line string.

Converts a Polygon to a MultiLineString by extracting its rings as line strings.

Link copied to clipboard
Link copied to clipboard

Converts a Point to a MultiPoint containing the single point.

Link copied to clipboard

Converts a Polygon to a MultiPolygon containing the single polygon.

Converts a GeometryCollection of LineStringGeometry to a MultiPolygon by converting each contained geometry using toPolygon.

Link copied to clipboard
fun LineStringGeometry.toPolygon(autoClose: Boolean = true, autoOrder: Boolean = true): Polygon

Converts a LineStringGeometry to a Polygon. The largest (or first, if autoOrder is false) LineString becomes the outer shell of the polygon, and subsequent line strings (if the receiver is MultiLineString become holes in the polygon.