class

GeoJSON::Feature

Inherits GeoJSON::Object < JSON::Serializable::Unmapped < JSON::Serializable < Reference < Object

A Feature represents a GeoJSON Feature object with a geometry and properties.

Constructors

new(pull : JSON::PullParser)

A Feature represents a GeoJSON Feature object with a geometry and properties.

Source
new(geometry : GeoJSON::Object | Nil, properties : Nil | Hash(String, Array(JSON::Any) | Bool | Float64 | Hash(String, JSON::Any) | Int64 | String | Nil) = nil, *, id : Int32 | String | Nil = nil, bbox = nil)

Creates a new Feature with the given geometry and optional properties, id, and bounding box bbox.

Source

Instance methods

bbox

Calculates the bounding box for any GeoJSON object, including FeatureCollection.

Source
geometry

Gets this Feature's geometry.

Source
id

Gets this Feature's id.

Source
properties

Gets this Feature's properties.

Source
type

Gets this Feature's GeoJSON type ("Feature")

Source