class GeoJSON::Feature
- GeoJSON::Feature
- GeoJSON::Object
- Reference
- Object
Overview
A Feature
represents a GeoJSON Feature object
with a geometry and properties.
Defined in:
geojson/feature.crConstructors
-
.new(pull : JSON::PullParser)
A
Feature
represents a GeoJSON Feature object with a geometry and properties. -
.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.
Instance Method Summary
-
#bbox
Calculates the bounding box for any GeoJSON object, including
FeatureCollection
. -
#geometry : GeoJSON::Object::Type | Nil
Gets this Feature's geometry.
-
#id : String | Int32 | Nil
Gets this Feature's id.
-
#properties : Hash(String, JSON::Any::Type) | Nil
Gets this Feature's properties.
-
#type : String
Gets this Feature's GeoJSON type ("Feature")
Instance methods inherited from class GeoJSON::Object
bbox
bbox,
type : String
type
Constructor methods inherited from class GeoJSON::Object
new(pull : JSON::PullParser)
new
Constructor Detail
def self.new(pull : JSON::PullParser)
#
A Feature
represents a GeoJSON Feature object
with a geometry and properties.
def self.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.
Instance Method Detail
def bbox
#
Description copied from class GeoJSON::Object
Calculates the bounding box for any GeoJSON object, including FeatureCollection
.