class GeoJSON::Polygon

Overview

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.

Defined in:

geojson/polygon.cr

Constructors

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

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.


[View source]
def self.new(coordinates : Array(Array(Coordinates)), *, bbox = nil) #

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


[View source]
def self.new(coordinates : Array(Array(Point)), *, bbox = nil) #

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


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

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


[View source]

Instance Method Detail

def bbox #
Description copied from class GeoJSON::Object

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


[View source]
def coordinates : Array(Array(Coordinates)) #

Returns this Polygon's linear ring coordinates.


[View source]
def type : String #

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


[View source]