class GeoJSON::GeometryCollection
- GeoJSON::GeometryCollection
- GeoJSON::Object
- Reference
- Object
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
GeometryCollection
s inside one another, but this is discouraged by the
specification.
This class corresponds to the GeoJSON GeometryCollection.
Defined in:
geojson/geometry_collection.crConstructors
-
.new(pull : JSON::PullParser)
Deserializes a
GeometryCollection
from the given JSON parser. -
.new(geometries : Array(GeoJSON::Object::Type), *, bbox = nil)
Creates a new
GeometryCollection
containing the given geometries and optional bounding box bbox.
Class Method Summary
Instance Method Summary
-
#bbox
Calculates the bounding box for any GeoJSON object, including
FeatureCollection
. -
#geometries : Array(GeoJSON::Object::Type)
Returns an array of the geometries in this
GeometryCollection
-
#type : String
Gets this GeometryCollection's GeoJSON type ("GeometryCollection")
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
Deserializes a GeometryCollection
from the given JSON parser.
Creates a new GeometryCollection
containing the given geometries and
optional bounding box bbox.
Class Method Detail
Instance Method Detail
Calculates the bounding box for any GeoJSON object, including FeatureCollection
.
Returns an array of the geometries in this GeometryCollection