Feature

@Serializable(with = FeatureSerializer::class)
class Feature(val geometry: Geometry?, properties: Map<String, JsonElement> = emptyMap(), val id: String? = null, val bbox: BoundingBox? = null) : GeoJson

A feature object represents a spatially bounded thing.

See also

Constructors

Link copied to clipboard
constructor(geometry: Geometry?, properties: Map<String, JsonElement> = emptyMap(), id: String? = null, bbox: BoundingBox? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val bbox: BoundingBox? = null

An optional bounding box used to represent the limits of the object's geometry.

Link copied to clipboard

A Geometry object contained within the feature.

Link copied to clipboard
val id: String? = null

An optionally included string that commonly identifies this feature.

Link copied to clipboard
val properties: Map<String, JsonElement>

Additional properties about this feature. When serialized, any non-simple types will be serialized into JSON objects.

Functions

Link copied to clipboard
operator fun component1(): Geometry?
Link copied to clipboard
operator fun component2(): Map<String, JsonElement>
Link copied to clipboard
operator fun component3(): String?
Link copied to clipboard
operator fun component4(): BoundingBox?
Link copied to clipboard
fun copy(geometry: Geometry? = this.geometry, properties: Map<String, JsonElement> = this.properties, id: String? = this.id, bbox: BoundingBox? = this.bbox): Feature
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
fun getJsonProperty(key: String): JsonElement?
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "getPropertyCast")
inline fun <T> getProperty(key: String): T?

Gets the value of the property with the given key.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun json(): String

Gets a JSON representation of this object.

Link copied to clipboard
Link copied to clipboard
fun setBooleanProperty(key: String, value: Boolean?)
Link copied to clipboard
fun setJsonProperty(key: String, value: JsonElement)
Link copied to clipboard
fun setNumberProperty(key: String, value: Number?)
Link copied to clipboard
fun setStringProperty(key: String, value: String?)
Link copied to clipboard
open override fun toString(): String