Package-level declarations

Classes to serialize and deserialize GeoJSON data.

Types

Link copied to clipboard
@Serializable
@SerialName(value = "Feature")
data class Feature @JvmOverloads constructor(val geometry: Geometry, val id: String? = null, val properties: JsonObject? = null) : GeoJsonObject

A Feature contains a Geometry, an optional id, and optional properties.

Link copied to clipboard
@Serializable
@SerialName(value = "FeatureCollection")
data class FeatureCollection(val features: Array<GeoJsonObject>) : GeoJsonObject

A FeatureCollection is an array of features.

Link copied to clipboard
@Serializable
sealed class GeoJsonObject

Marker interface to indicate a GeoJson object. It can be a Geometry, a Feature or a FeatureCollection

Link copied to clipboard
@Serializable
sealed class Geometry : GeoJsonObject
Link copied to clipboard
@Serializable
@SerialName(value = "GeometryCollection")
data class GeometryCollection(val geometries: Array<Geometry>) : Geometry
Link copied to clipboard
typealias Line = Positions

Type alias for a line.

Link copied to clipboard
typealias Lines = Array<Line>

Type alias of an array of lines.

Link copied to clipboard
@Serializable
@SerialName(value = "LineString")
data class LineString(val coordinates: Line) : Geometry
Link copied to clipboard
@Serializable
@SerialName(value = "MultiLineString")
data class MultiLineString(val coordinates: Lines) : Geometry
Link copied to clipboard
@Serializable
@SerialName(value = "MultiPoint")
data class MultiPoint(val coordinates: Positions) : Geometry
Link copied to clipboard
@Serializable
@SerialName(value = "MultiPolygon")
data class MultiPolygon(val coordinates: Surface) : Geometry
Link copied to clipboard
@Serializable
@SerialName(value = "Point")
data class Point(val coordinates: Position) : Geometry
Link copied to clipboard
@Serializable
@SerialName(value = "Polygon")
data class Polygon(val coordinates: Lines) : Geometry
Link copied to clipboard
typealias Position = DoubleArray

Position is an alias on a DoubleArray that represents the coordinates in degrees for longitude (index = 0), latitude (index = 1) and altitude (meters). The altitude is not a mandatory information. The position can be 2 length array or a 3 length array (with altitude)

Link copied to clipboard
typealias Positions = Array<Position>

Type alias of an array of Positions

Link copied to clipboard
typealias Surface = Array<Lines>

Type alias of a surface.

Properties

Link copied to clipboard
Link copied to clipboard

Get a BoundingBox of multiple lines.

Get a BoundingBox of a line or a series of positions.

Get a BoundingBox of a given position.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Convert a String into a GeoJsonObject.

Link copied to clipboard
fun Map<String, Any>.toJsonObject(): JsonObject

EXPERIMENTAL Convert a Map into a generic JsonObject.

Link copied to clipboard