Skip to content

Geo

GeoJSON types supported by MongoDB.

Our goal is to represent the GeoJSON RFC, as it is implemented by MongoDB. MongoDB does not support large sections of the RFC, so we won't support them either.

GeoJSON operators calculate on a sphere, using the WGS84 reference system.

External resources

Inheritors

Types

CoordinateReferenceSystem

data class CoordinateReferenceSystem(val name: String)

A coordinate reference system (CRS) represents the way points are projected.

GeometryCollection

A GeoJSON geometry collection.

Latitude

@JvmInline
value class Latitude(val degrees: Double)

A latitude.

LineString

A GeoJSON line string.

Longitude

@JvmInline
value class Longitude(val degrees: Double)

A longitude.

MultiLineString

A GeoJSON MultiLineString.

MultiPoint

A GeoJSON MultiPoint.

MultiPolygon

A GeoJSON MultiPolygon.

Point

A GeoJSON point.

Polygon

A GeoJSON polygon.

Serializer

Functions

toString

abstract override fun toString(): String

JSON representation of this object as a BSON document.

writeTo

@LowLevelApi
abstract fun writeTo(writer: BsonFieldWriter)

Writes this object to the provided writer.