Feature

@Serializable(with = FeatureSerializer::class)
data class Feature<out G : Geometry?, out P> @JvmOverloads constructor(val geometry: G, val properties: P, val id: String? = null, val bbox: BoundingBox? = null) : GeoJsonObject(source)

A Feature object represents a spatially bounded thing.

See RFC 7946 Section 3.2 for the full specification.

Parameters

G

The type of Geometry contained in this Feature.

P

The type of properties. This can be any type that serializes to a JSON object. For dynamic or unknown property schemas, use JsonObject. For known schemas, use a Serializable data class.

See also

Constructors

Link copied to clipboard
constructor(geometry: G, properties: P, id: String? = null, bbox: BoundingBox? = null)

Types

Link copied to clipboard
object Companion

Factory methods for creating and serializing Feature objects.

Properties

Link copied to clipboard
open override val bbox: BoundingBox?

An optional BoundingBox used to represent the limits of the object's Geometry.

Link copied to clipboard
val geometry: G

A Geometry object contained within the Feature.

Link copied to clipboard
val id: String?

An optionally included string that commonly identifies this Feature.

Link copied to clipboard

Additional properties about this Feature. It should be serializable into a JsonObject.

Functions

Link copied to clipboard

Checks if a property exists in the feature's JsonObject properties.

Link copied to clipboard

Gets a boolean property from the feature's JsonObject properties.

Link copied to clipboard

Gets a double property from the feature's JsonObject properties.

Link copied to clipboard

Gets an integer property from the feature's JsonObject properties.

Link copied to clipboard

Gets a string property from the feature's JsonObject properties.