class

GeoJSON::GeometryCollection

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

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.

Constructors

new(pull : JSON::PullParser)

Deserializes a GeometryCollection from the given JSON parser.

Source
new(geometries : Array(GeoJSON::Object::Type), *, bbox = nil)

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

Source

Class methods

read_geometries(pull : JSON::PullParser)
Source

Instance methods

bbox

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

Source
geometries

Returns an array of the geometries in this GeometryCollection

Source
type

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

Source