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.


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

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


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

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


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

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


Instance Method Detail

def bbox #
Description copied from class GeoJSON::Object

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


def coordinates : Array(Array(Coordinates)) #

Returns this Polygon's linear ring coordinates.


def type : String #

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