class GeoJSON::Feature

Overview

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

Defined in:

geojson/feature.cr

Constructors

Instance Method Summary

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.


def geometry : GeoJSON::Object::Type | Nil #

Gets this Feature's geometry.


def id : String | Int32 | Nil #

Gets this Feature's id.


def properties : Hash(String, JSON::Any::Type) | Nil #

Gets this Feature's properties.


def type : String #

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