class GeoJSON::Polygon
- GeoJSON::Polygon
- GeoJSON::Object
- 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.
Defined in:
geojson/polygon.crConstructors
-
.new(pull : JSON::PullParser)
A
Polygon
is aGeometry
representing a closed geometric figure in geographic space with optional holes within it. -
.new(coordinates : Array(Array(Coordinates)), *, bbox = nil)
Creates a new
Polygon
with the given coordinates and optional bounding box bbox. -
.new(coordinates : Array(Array(Point)), *, bbox = nil)
Creates a new
Polygon
with the given coordinates and optional bounding box bbox. -
.new(coordinates : Array(Array(Array(Float64))), *, bbox = nil)
Creates a new
Polygon
with the given coordinates and optional bounding box bbox.
Instance Method Summary
-
#bbox
Calculates the bounding box for any GeoJSON object, including
FeatureCollection
. -
#coordinates : Array(Array(Coordinates))
Returns this Polygon's linear ring coordinates.
-
#type : String
Gets this Polygon's GeoJSON type ("Polygon")
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
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.
Creates a new Polygon
with the given coordinates and optional bounding
box bbox.
Instance Method Detail
Calculates the bounding box for any GeoJSON object, including FeatureCollection
.