class GeoJSON::GeometryCollection

Overview

A GeometryCollection represents a collection of several geometries.

Its array of geometries can contain Point, MultiPoint, LineString, MultiLineString, Polygon, and MultiPolygon. Technically, you can nest GeometryCollections inside one another, but this is discouraged by the specification.

This class corresponds to the GeoJSON GeometryCollection.

Defined in:

geojson/geometry_collection.cr

Constructors

Class Method Summary

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) #

Deserializes a GeometryCollection from the given JSON parser.


def self.new(geometries : Array(GeoJSON::Object::Type), *, bbox = nil) #

Creates a new GeometryCollection containing the given geometries and optional bounding box bbox.


Class Method Detail

def self.read_geometries(pull : JSON::PullParser) #

Instance Method Detail

def bbox #
Description copied from class GeoJSON::Object

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


def geometries : Array(GeoJSON::Object::Type) #

Returns an array of the geometries in this GeometryCollection


def type : String #

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