class GeoJSON::MultiPolygon

Overview

A MultiPolygon is a Geometry representing several Polygons.

This class corresponds to the GeoJSON MultiPolygon.

Defined in:

geojson/multi_polygon.cr

Constructors

Instance Method Summary

Instance methods inherited from class GeoJSON::Object

bbox : Array(Float64) | Nil 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 MultiPolygon is a Geometry representing several Polygons.

This class corresponds to the GeoJSON MultiPolygon.


def self.new(coordinates : Array(Polygon), *, bbox = nil) #

Create a new MultiPolygon with the given coordinates and optional bounding box bbox.


def self.new(coordinates : Array(Array(Array(Array(Float64)))), *, bbox = nil) #

Create a new MultiPolygon with the given coordinates and optional bounding box bbox.


Instance Method Detail

def <<(polygon : Array(Polygon)) #

Adds the given polygon to this MultiPolygon.


def <<(coordinate : Array(Array(Array(Float64)))) #

Adds the given coordinate to this MultiPolygon.


def [](*args, **options) #

Gets the Polygon at the given index.


def [](*args, **options, &) #

Gets the Polygon at the given index.


def coordinates : Array(Array(Array(GeoJSON::Coordinates))) #

Returns an array of this MultiPolygon's coordinates.


def type : String #

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