class GeoJSON::Polygon
- GeoJSON::Polygon
- GeoJSON::Geometry
- GeoJSON::Base
- Reference
- Object
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
- GeoJSON::SingleGeometry(GeoJSON::Coordinates::PolyRings)
- JSON::Serializable
Defined in:
geojson/geometry/polygon.crConstructors
- .new(pull : JSON::PullParser)
-
.new(rings : Array(LinearRing))
Creates a new
Polygon
with the given rings. -
.new(points : Array)
Create a new
Polygon
with an outer ring defined by the given points and no holes.
Instance Method Summary
-
#exterior
Returns the exterior
LinearRing
of thisPolygon
-
#type : String
Gets this Polygon's GeoJSON type ("Polygon")
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(points : Array)
#
Create a new Polygon
with an outer ring defined by the given points and
no holes.