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.

Included Modules

Defined in:

geojson/geometry/polygon.cr

Constructors

Instance Method Summary

Instance methods inherited from module GeoJSON::SingleGeometry(GeoJSON::Coordinates::PolyRings)

coordinates : T coordinates

Constructor methods inherited from module GeoJSON::SingleGeometry(GeoJSON::Coordinates::PolyRings)

new(coordinates : Array)
new(coordinates : CoordinateTree)
new(coordinates : T)
new

Instance methods inherited from class GeoJSON::Geometry

==(other : self) ==, [](*args, **options)
[](*args, **options, &)
[]
, coordinates coordinates, hash(hasher) hash

Constructor methods inherited from class GeoJSON::Geometry

new(parser : JSON::PullParser) new

Class methods inherited from class GeoJSON::Geometry

from_json(geometry_json) from_json

Instance methods inherited from class GeoJSON::Base

type : String type

Constructor Detail

def self.new(pull : JSON::PullParser) #

def self.new(rings : Array(LinearRing)) #

Creates a new Polygon with the given rings.


[View source]
def self.new(points : Array) #

Create a new Polygon with an outer ring defined by the given points and no holes.


[View source]

Instance Method Detail

def exterior #

Returns the exterior LinearRing of this Polygon


[View source]
def type : String #

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


[View source]