class

GeoJSON::Polygon

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

A Polygon is a Geometry representing a closed geometric figure in geographic space with optional holes within it.

This class corresponds to the GeoJSON Polygon.

Constructors

new(pull : JSON::PullParser)

A Polygon is a Geometry representing a closed geometric figure in geographic space with optional holes within it.

This class corresponds to the GeoJSON Polygon.

Source
new(coordinates : Array(Array(Coordinates)), *, bbox = nil)

Creates a new Polygon with the given coordinates and optional bounding box bbox.

Source
new(coordinates : Array(Array(Point)), *, bbox = nil)

Creates a new Polygon with the given coordinates and optional bounding box bbox.

Source
new(coordinates : Array(Array(Array(Float64))), *, bbox = nil)

Creates a new Polygon with the given coordinates and optional bounding box bbox.

Source

Instance methods

bbox

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

Source
coordinates

Returns this Polygon's linear ring coordinates.

Source
type

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

Source