From 854fa86fc178a222914363c04d0862992bc60edd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 31 Mar 2024 15:46:10 +0000 Subject: [PATCH] Deploy to GitHub pages --- 404.html | 162 +++++ GeoJSON.html | 291 ++++++++ GeoJSON/Coordinates.html | 610 +++++++++++++++++ GeoJSON/Exception.html | 266 ++++++++ GeoJSON/Feature.html | 546 +++++++++++++++ GeoJSON/FeatureCollection.html | 493 ++++++++++++++ GeoJSON/GeometryCollection.html | 538 +++++++++++++++ GeoJSON/LineString.html | 602 +++++++++++++++++ GeoJSON/MultiLineString.html | 625 ++++++++++++++++++ GeoJSON/MultiPoint.html | 625 ++++++++++++++++++ GeoJSON/MultiPolygon.html | 625 ++++++++++++++++++ GeoJSON/Object.html | 442 +++++++++++++ GeoJSON/Object/Type.html | 233 +++++++ GeoJSON/Point.html | 770 ++++++++++++++++++++++ GeoJSON/Polygon.html | 550 ++++++++++++++++ css/style.css | 980 +++++++++++++++++++++++++++ index.html | 538 +++++++++++++++ index.json | 1 + js/doc.js | 1099 +++++++++++++++++++++++++++++++ search-index.js | 1 + 20 files changed, 9997 insertions(+) create mode 100644 404.html create mode 100644 GeoJSON.html create mode 100644 GeoJSON/Coordinates.html create mode 100644 GeoJSON/Exception.html create mode 100644 GeoJSON/Feature.html create mode 100644 GeoJSON/FeatureCollection.html create mode 100644 GeoJSON/GeometryCollection.html create mode 100644 GeoJSON/LineString.html create mode 100644 GeoJSON/MultiLineString.html create mode 100644 GeoJSON/MultiPoint.html create mode 100644 GeoJSON/MultiPolygon.html create mode 100644 GeoJSON/Object.html create mode 100644 GeoJSON/Object/Type.html create mode 100644 GeoJSON/Point.html create mode 100644 GeoJSON/Polygon.html create mode 100644 css/style.css create mode 100644 index.html create mode 100644 index.json create mode 100644 js/doc.js create mode 100644 search-index.js diff --git a/404.html b/404.html new file mode 100644 index 0000000..c99ed8a --- /dev/null +++ b/404.html @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + geojson 0.5.0 + + + + + + + + + + +
+

+ 404 Not Found +

+ +

+ This page is unavailable in this version of the API docs. +

+ +

+ You can use the sidebar to search for your page, or try a different + Crystal version. +

+ +
+ + diff --git a/GeoJSON.html b/GeoJSON.html new file mode 100644 index 0000000..bfcba1a --- /dev/null +++ b/GeoJSON.html @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + GeoJSON - geojson 0.5.0 + + + + + + + + + + +
+

+ + module GeoJSON + +

+ + + + + + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson.cr + +
+ + + geojson/coordinates.cr + +
+ + + geojson/exception.cr + +
+ + + geojson/feature.cr + +
+ + + geojson/feature_collection.cr + +
+ + + geojson/geometry_collection.cr + +
+ + + geojson/line_string.cr + +
+ + + geojson/multi_line_string.cr + +
+ + + geojson/multi_point.cr + +
+ + + geojson/multi_polygon.cr + +
+ + + geojson/object.cr + +
+ + + geojson/point.cr + +
+ + + geojson/polygon.cr + +
+ + + + + +

+ + + + Constant Summary +

+ +
+ +
+ VERSION = {{ (`shards version /__w/geojson/geojson/src`).chomp.stringify }} +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ + + diff --git a/GeoJSON/Coordinates.html b/GeoJSON/Coordinates.html new file mode 100644 index 0000000..1391a8b --- /dev/null +++ b/GeoJSON/Coordinates.html @@ -0,0 +1,610 @@ + + + + + + + + + + + + + + + + + GeoJSON::Coordinates - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::Coordinates + +

+ + + + + + + +

+ + + + Overview +

+ +

A Coordinates is a position in longitude, latitude, and (optionally) +altitude.

+

This class corresponds to the GeoJSON Position.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/coordinates.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + + + + + +

+ + + + Instance Method Summary +

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

+ +
+
+ + def self.new(longitude : Float64, latitude : Float64, altitude : Float64 | Nil = nil) + + # +
+ +
+ +

Creates a new Coordinates with the given longitude, latitude and altitude.

+
+ +
+
+ +
+
+ +
+
+ + def self.new(coordinates : Array(Float64)) + + # +
+ +
+ +

Creates a new Coordinates with the given coordinates array.

+
+ +
+
+ +
+
+ +
+
+ + def self.new(parser : JSON::PullParser) + + # +
+ +
+ +

Deserializes a Coordinates from the given JSON parser.

+
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def ==(other : self) + + # +
+ +
+ +
+ Description copied from class Reference +
+ +

Returns true if this reference is the same as other. Invokes same?.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options) + + # +
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options, &) + + # +
+ +
+
+ +
+
+ +
+
+ + def altitude + + # +
+ +
+ +

Gets this Coordinates' altitude.

+

Technically, this positional value is meant to be the height in meters +above the WGS84 ellipsoid.

+
+ +
+
+ +
+
+ +
+
+ + def coordinates : Array(Float64) + + # +
+ +
+
+ +
+
+ +
+
+ + def hash(hasher) + + # +
+ +
+ +
+ Description copied from class Reference +
+ +

See Object#hash(hasher)

+
+ +
+
+ +
+
+ +
+
+ + def latitude + + # +
+ +
+ +

Gets this Coordinates' latitude in decimal degrees according to WGS84.

+
+ +
+
+ +
+
+ +
+
+ + def longitude + + # +
+ +
+ +

Gets this Coordinates' longitude in decimal degrees according to WGS84.

+
+ +
+
+ +
+
+ +
+
+ + def to_json(*args, **options) + + # +
+ +
+
+ +
+
+ +
+
+ + def to_json(*args, **options, &) + + # +
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/Exception.html b/GeoJSON/Exception.html new file mode 100644 index 0000000..df700ba --- /dev/null +++ b/GeoJSON/Exception.html @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + GeoJSON::Exception - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::Exception + +

+ + + + + + + +

+ + + + Overview +

+ +

Raised when an attempt is made to create a GeoJSON object that is malformed.

+

In most cases, this means that the given coordinates for a geometry object +don't fulfill the requirements for that geometry type.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/exception.cr + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + diff --git a/GeoJSON/Feature.html b/GeoJSON/Feature.html new file mode 100644 index 0000000..a16f0a5 --- /dev/null +++ b/GeoJSON/Feature.html @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + GeoJSON::Feature - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::Feature + +

+ + + + + + + +

+ + + + Overview +

+ +

A Feature represents a GeoJSON Feature object +with a geometry and properties.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/feature.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 Feature represents a GeoJSON Feature object +with a geometry and properties.

+
+ +
+
+ +
+
+ +
+
+ + def self.new(geometry : GeoJSON::Object | Nil, properties : Nil | Hash(String, Array(JSON::Any) | Bool | Float64 | Hash(String, JSON::Any) | Int64 | String | Nil) = nil, *, id : Int32 | String | Nil = nil, bbox = nil) + + # +
+ +
+ +

Creates a new Feature with the given geometry and optional +properties, id, and 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 geometry : GeoJSON::Object::Type | Nil + + # +
+ +
+ +

Gets this Feature's geometry.

+
+ +
+
+ +
+
+ +
+
+ + def id : String | Int32 | Nil + + # +
+ +
+ +

Gets this Feature's id.

+
+ +
+
+ +
+
+ +
+
+ + def properties : Hash(String, JSON::Any::Type) | Nil + + # +
+ +
+ +

Gets this Feature's properties.

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/FeatureCollection.html b/GeoJSON/FeatureCollection.html new file mode 100644 index 0000000..3f93d00 --- /dev/null +++ b/GeoJSON/FeatureCollection.html @@ -0,0 +1,493 @@ + + + + + + + + + + + + + + + + + GeoJSON::FeatureCollection - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::FeatureCollection + +

+ + + + + + + +

+ + + + Overview +

+ +

A FeatureCollection represents a GeoJSON FeatureCollection object +and contains one or more Features.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/feature_collection.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 FeatureCollection represents a GeoJSON FeatureCollection object +and contains one or more Features.

+
+ +
+
+ +
+
+ +
+
+ + def self.new(features : Array(Feature), *, bbox = nil) + + # +
+ +
+ +

Creates a new FeatureCollection with the given features.

+
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def bbox + + # +
+ +
+ +
+ Description copied from class GeoJSON::Object +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def features : Array(Feature) + + # +
+ +
+ +

Returns this FeatureCollections array of features.

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/GeometryCollection.html b/GeoJSON/GeometryCollection.html new file mode 100644 index 0000000..1ebea4c --- /dev/null +++ b/GeoJSON/GeometryCollection.html @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + GeoJSON::GeometryCollection - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::GeometryCollection + +

+ + + + + + + +

+ + + + Overview +

+ +

A GeometryCollection represents a collection of several geometries.

+

Its array of geometries can contain Point, MultiPoint, LineString, +MultiLineString, Polygon, and MultiPolygon. Technically, you can nest +GeometryCollections inside one another, but this is discouraged by the +specification.

+

This class corresponds to the GeoJSON GeometryCollection.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/geometry_collection.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + +

+ + + + Class Method Summary +

+ + + + + + +

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

Deserializes a GeometryCollection from the given JSON parser.

+
+ +
+
+ +
+
+ +
+
+ + def self.new(geometries : Array(GeoJSON::Object::Type), *, bbox = nil) + + # +
+ +
+ +

Creates a new GeometryCollection containing the given geometries and +optional bounding box bbox.

+
+ +
+
+ +
+
+ + + + +

+ + + + Class Method Detail +

+ +
+
+ + def self.read_geometries(pull : JSON::PullParser) + + # +
+ +
+
+ +
+
+ + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def bbox + + # +
+ +
+ +
+ Description copied from class GeoJSON::Object +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def geometries : Array(GeoJSON::Object::Type) + + # +
+ +
+ +

Returns an array of the geometries in this GeometryCollection

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/LineString.html b/GeoJSON/LineString.html new file mode 100644 index 0000000..97540de --- /dev/null +++ b/GeoJSON/LineString.html @@ -0,0 +1,602 @@ + + + + + + + + + + + + + + + + + GeoJSON::LineString - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::LineString + +

+ + + + + + + +

+ + + + Overview +

+ +

A LineString is a Geometry representing two or more points in geographic +space connected consecutively by lines.

+

This class corresponds to the GeoJSON LineString.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/line_string.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 LineString is a Geometry representing two or more points in geographic +space connected consecutively by lines.

+

This class corresponds to the GeoJSON LineString.

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

Create a new LineString with the given coordinates and optional +bounding box bbox.

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

Create a new LineString with the given coordinates and optional +bounding box bbox.

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

Create a new LineString with the given coordinates and optional +bounding box bbox.

+
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def [](*args, **options) + + # +
+ +
+ +

Gets the LineString vertex at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options, &) + + # +
+ +
+ +

Gets the LineString vertex at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def bbox + + # +
+ +
+ +
+ Description copied from class GeoJSON::Object +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def coordinates : Array(Coordinates) + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/MultiLineString.html b/GeoJSON/MultiLineString.html new file mode 100644 index 0000000..6aa4498 --- /dev/null +++ b/GeoJSON/MultiLineString.html @@ -0,0 +1,625 @@ + + + + + + + + + + + + + + + + + GeoJSON::MultiLineString - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::MultiLineString + +

+ + + + + + + +

+ + + + Overview +

+ +

A MultiLineString is a Geometry representing several LineStrings.

+

This class corresponds to the GeoJSON MultiLineString.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/multi_line_string.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 MultiLineString is a Geometry representing several LineStrings.

+

This class corresponds to the GeoJSON MultiLineString.

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

Create a new MultiLineString with the given coordinates and optional +bounding box bbox.

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

Create a new MultiLineString with the given coordinates and optional +bounding box bbox.

+
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def <<(line_string : Array(LineString)) + + # +
+ +
+ +

Adds the given line_string to this MultiLineString.

+
+ +
+
+ +
+
+ +
+
+ + def <<(coordinate : Array(Array(Float64))) + + # +
+ +
+ +

Adds the given coordinate to this MultiLineString.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options) + + # +
+ +
+ +

Gets the LineString at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options, &) + + # +
+ +
+ +

Gets the LineString at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def bbox + + # +
+ +
+ +
+ Description copied from class GeoJSON::Object +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def coordinates : Array(Array(GeoJSON::Coordinates)) + + # +
+ +
+ +

Returns an array of this MultiLineString's coordinates.

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/MultiPoint.html b/GeoJSON/MultiPoint.html new file mode 100644 index 0000000..374e599 --- /dev/null +++ b/GeoJSON/MultiPoint.html @@ -0,0 +1,625 @@ + + + + + + + + + + + + + + + + + GeoJSON::MultiPoint - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::MultiPoint + +

+ + + + + + + +

+ + + + Overview +

+ +

A MultiPoint is a Geometry representing several Points.

+

This class corresponds to the GeoJSON MultiPoint.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/multi_point.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 MultiPoint is a Geometry representing several Points.

+

This class corresponds to the GeoJSON MultiPoint.

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

Create a new MultiPoint with the given coordinates and optional +bounding box bbox.

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

Create a new MultiPoint with the given coordinates and optional +bounding box bbox.

+
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def <<(point : Array(Point)) + + # +
+ +
+ +

Adds the given point to this MultiPoint.

+
+ +
+
+ +
+
+ +
+
+ + def <<(coordinate : Array(Float64)) + + # +
+ +
+ +

Adds the given coordinate to this MultiPoint.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options) + + # +
+ +
+ +

Gets the Point at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options, &) + + # +
+ +
+ +

Gets the Point at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def bbox + + # +
+ +
+ +
+ Description copied from class GeoJSON::Object +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def coordinates : Array(Coordinates) + + # +
+ +
+ +

Returns an array of this MultiPoint's coordinates.

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/MultiPolygon.html b/GeoJSON/MultiPolygon.html new file mode 100644 index 0000000..aa19c97 --- /dev/null +++ b/GeoJSON/MultiPolygon.html @@ -0,0 +1,625 @@ + + + + + + + + + + + + + + + + + GeoJSON::MultiPolygon - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::MultiPolygon + +

+ + + + + + + +

+ + + + Overview +

+ +

A MultiPolygon is a Geometry representing several Polygons.

+

This class corresponds to the GeoJSON MultiPolygon.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/multi_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 MultiPolygon is a Geometry representing several Polygons.

+

This class corresponds to the GeoJSON MultiPolygon.

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

Create a new MultiPolygon with the given coordinates and optional +bounding box bbox.

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

Create a new MultiPolygon with the given coordinates and optional +bounding box bbox.

+
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def <<(polygon : Array(Polygon)) + + # +
+ +
+ +

Adds the given polygon to this MultiPolygon.

+
+ +
+
+ +
+
+ +
+
+ + def <<(coordinate : Array(Array(Array(Float64)))) + + # +
+ +
+ +

Adds the given coordinate to this MultiPolygon.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options) + + # +
+ +
+ +

Gets the Polygon at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def [](*args, **options, &) + + # +
+ +
+ +

Gets the Polygon at the given index.

+
+ +
+
+ +
+
+ +
+
+ + def bbox + + # +
+ +
+ +
+ Description copied from class GeoJSON::Object +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def coordinates : Array(Array(Array(GeoJSON::Coordinates))) + + # +
+ +
+ +

Returns an array of this MultiPolygon's coordinates.

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/Object.html b/GeoJSON/Object.html new file mode 100644 index 0000000..03ad61d --- /dev/null +++ b/GeoJSON/Object.html @@ -0,0 +1,442 @@ + + + + + + + + + + + + + + + + + GeoJSON::Object - geojson 0.5.0 + + + + + + + + + + +
+

+ + abstract class GeoJSON::Object + +

+ + + + + + + +

+ + + + Overview +

+ +

GeoJSON Object

+

A GeoJSON object represents a Geometry, Feature, or collection of Features.

+ + + + + + +

+ + + + Included Modules +

+ + + + + + +

+ + + + Direct Known Subclasses +

+ + + + + + + +

+ + + + Defined in: +

+ + + geojson/object.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + + + + + +

+ + + + Instance Method Summary +

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

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

+ + + + Instance Method Detail +

+ +
+
+ abstract + def bbox + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ abstract + def type : String + + # +
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/Object/Type.html b/GeoJSON/Object/Type.html new file mode 100644 index 0000000..3ffdaef --- /dev/null +++ b/GeoJSON/Object/Type.html @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + GeoJSON::Object::Type - geojson 0.5.0 + + + + + + + + + + +
+

+ + alias GeoJSON::Object::Type + +

+ + + + + +

+ + + + Overview +

+ +

All possible GeoJSON types.

+ + + +

+ + + + Alias Definition +

+ GeoJSON::Object + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/object.cr + +
+ + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ + + diff --git a/GeoJSON/Point.html b/GeoJSON/Point.html new file mode 100644 index 0000000..3214162 --- /dev/null +++ b/GeoJSON/Point.html @@ -0,0 +1,770 @@ + + + + + + + + + + + + + + + + + GeoJSON::Point - geojson 0.5.0 + + + + + + + + + + +
+

+ + class GeoJSON::Point + +

+ + + + + + + +

+ + + + Overview +

+ +

A Point is a Geometry representing a single Position in geographic +space.

+

This class corresponds to the GeoJSON Point.

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + geojson/point.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(longitude, latitude, altitude = nil, bbox = nil) + + # +
+ +
+ +

Creates a new Point at the given longitude, latitude, and optional +altitude, and with optional bounding box bbox.

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

A Point is a Geometry representing a single Position in geographic +space.

+

This class corresponds to the GeoJSON Point.

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

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

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

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

+
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def ==(other : self) + + # +
+ +
+ +
+ Description copied from class Reference +
+ +

Returns true if this reference is the same as other. Invokes same?.

+
+ +
+
+ +
+
+ +
+
+ + def altitude(*args, **options) + + # +
+ +
+ +

Gets this Point's altitude.

+

Technically, this positional value is meant to be the height in meters +above the WGS84 ellipsoid.

+
+ +
+
+ +
+
+ +
+
+ + def altitude(*args, **options, &) + + # +
+ +
+ +

Gets this Point's altitude.

+

Technically, this positional value is meant to be the height in meters +above the WGS84 ellipsoid.

+
+ +
+
+ +
+
+ +
+
+ + def bbox + + # +
+ +
+ +
+ Description copied from class GeoJSON::Object +
+ +

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

+
+ +
+
+ +
+
+ +
+
+ + def coordinates : Coordinates + + # +
+ +
+ +

Returns this Point's coordinates.

+
+ +
+
+ +
+
+ +
+
+ + def hash(hasher) + + # +
+ +
+ +
+ Description copied from class Reference +
+ +

See Object#hash(hasher)

+
+ +
+
+ +
+
+ +
+
+ + def latitude(*args, **options) + + # +
+ +
+ +

Gets this Point's latitude in decimal degrees according to WGS84.

+
+ +
+
+ +
+
+ +
+
+ + def latitude(*args, **options, &) + + # +
+ +
+ +

Gets this Point's latitude in decimal degrees according to WGS84.

+
+ +
+
+ +
+
+ +
+
+ + def longitude(*args, **options) + + # +
+ +
+ +

Gets this Point's longitude in decimal degrees according to WGS84.

+
+ +
+
+ +
+
+ +
+
+ + def longitude(*args, **options, &) + + # +
+ +
+ +

Gets this Point's longitude in decimal degrees according to WGS84.

+
+ +
+
+ +
+
+ +
+
+ + def type : String + + # +
+ +
+ +

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

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/GeoJSON/Polygon.html b/GeoJSON/Polygon.html new file mode 100644 index 0000000..baddb64 --- /dev/null +++ b/GeoJSON/Polygon.html @@ -0,0 +1,550 @@ + + + + + + + + + + + + + + + + + GeoJSON::Polygon - geojson 0.5.0 + + + + + + + + + + +
+

+ + 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")

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..3d0a8a5 --- /dev/null +++ b/css/style.css @@ -0,0 +1,980 @@ +:root { + color-scheme: light dark; +} + +html, body { + background: #FFFFFF; + position: relative; + margin: 0; + padding: 0; + width: 100%; + height: 100%; + overflow: hidden; +} + +body { + font-family: "Avenir", "Tahoma", "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + color: #333; + line-height: 1.5; +} + +a { + color: #263F6C; +} + +a:visited { + color: #112750; +} + +h1, h2, h3, h4, h5, h6 { + margin: 35px 0 25px; + color: #444444; +} + +h1.type-name { + color: #47266E; + margin: 20px 0 30px; + background-color: #F8F8F8; + padding: 10px 12px; + border: 1px solid #EBEBEB; + border-radius: 2px; +} + +h2 { + border-bottom: 1px solid #E6E6E6; + padding-bottom: 5px; +} + +body { + display: flex; +} + +.sidebar, .main-content { + overflow: auto; +} + +.sidebar { + width: 30em; + color: #F8F4FD; + background-color: #2E1052; + padding: 0 0 30px; + box-shadow: inset -3px 0 4px rgba(0,0,0,.35); + line-height: 1.2; + z-index: 0; +} + +.sidebar .search-box { + padding: 13px 9px; +} + +.sidebar input { + display: block; + box-sizing: border-box; + margin: 0; + padding: 5px; + font: inherit; + font-family: inherit; + line-height: 1.2; + width: 100%; + border: 0; + outline: 0; + border-radius: 2px; + box-shadow: 0px 3px 5px rgba(0,0,0,.25); + transition: box-shadow .12s; +} + +.sidebar input:focus { + box-shadow: 0px 5px 6px rgba(0,0,0,.5); +} + +.sidebar input::-webkit-input-placeholder { /* Chrome/Opera/Safari */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.sidebar input::-moz-placeholder { /* Firefox 19+ */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.sidebar input:-ms-input-placeholder { /* IE 10+ */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.sidebar input:-moz-placeholder { /* Firefox 18- */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.project-summary { + padding: 9px 15px 30px 30px; +} + +.project-name { + font-size: 1.4rem; + margin: 0; + color: #f4f4f4; + font-weight: 600; +} + +.project-version { + margin-top: 5px; + display: inline-block; + position: relative; +} + +.project-version > form::after { + position: absolute; + right: 0; + top: 0; + content: "\25BC"; + font-size: .6em; + line-height: 1.2rem; + z-index: -1; +} + +.project-versions-nav { + cursor: pointer; + margin: 0; + padding: 0 .9em 0 0; + border: none; + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + background-color: transparent; + color: inherit; + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +.project-versions-nav:focus { + outline: none; +} + +.project-versions-nav > option { + color: initial; +} + +.sidebar ul { + margin: 0; + padding: 0; + list-style: none outside; +} + +.sidebar li { + display: block; + position: relative; +} + +.types-list li.hide { + display: none; +} + +.sidebar a { + text-decoration: none; + color: inherit; + transition: color .14s; +} +.types-list a { + display: block; + padding: 5px 15px 5px 30px; +} + +.types-list { + display: block; +} + +.sidebar a:focus { + outline: 1px solid #D1B7F1; +} + +.types-list a { + padding: 5px 15px 5px 30px; +} + +.sidebar .current > a, +.sidebar a:hover { + color: #866BA6; +} + +.types-list li ul { + overflow: hidden; + height: 0; + max-height: 0; + transition: 1s ease-in-out; +} + +.types-list li.parent { + padding-left: 30px; +} + +.types-list li.parent::before { + box-sizing: border-box; + content: "â–¼"; + display: block; + width: 30px; + height: 30px; + position: absolute; + top: 0; + left: 0; + text-align: center; + color: white; + font-size: 8px; + line-height: 30px; + transform: rotateZ(-90deg); + cursor: pointer; + transition: .2s linear; +} + + +.types-list li.parent > a { + padding-left: 0; +} + +.types-list li.parent.open::before { + transform: rotateZ(0); +} + +.types-list li.open > ul { + height: auto; + max-height: 1000em; +} + +.main-content { + padding: 0 30px 30px 30px; + width: 100%; +} + +.kind { + font-size: 60%; + color: #866BA6; +} + +.superclass-hierarchy { + margin: -15px 0 30px 0; + padding: 0; + list-style: none outside; + font-size: 80%; +} + +.superclass-hierarchy .superclass { + display: inline-block; + margin: 0 7px 0 0; + padding: 0; +} + +.superclass-hierarchy .superclass + .superclass::before { + content: "<"; + margin-right: 7px; +} + +.other-types-list li { + display: inline-block; +} + +.other-types-list, +.list-summary { + margin: 0 0 30px 0; + padding: 0; + list-style: none outside; +} + +.entry-const { + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; +} + +.entry-const code { + white-space: pre-wrap; +} + +.entry-summary { + padding-bottom: 4px; +} + +.superclass-hierarchy .superclass a, +.other-type a, +.entry-summary .signature { + padding: 4px 8px; + margin-bottom: 4px; + display: inline-block; + background-color: #f8f8f8; + color: #47266E; + border: 1px solid #f0f0f0; + text-decoration: none; + border-radius: 3px; + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; + transition: background .15s, border-color .15s; +} + +.superclass-hierarchy .superclass a:hover, +.other-type a:hover, +.entry-summary .signature:hover { + background: #D5CAE3; + border-color: #624288; +} + +.entry-summary .summary { + padding-left: 32px; +} + +.entry-summary .summary p { + margin: 12px 0 16px; +} + +.entry-summary a { + text-decoration: none; +} + +.entry-detail { + padding: 30px 0; +} + +.entry-detail .signature { + position: relative; + padding: 5px 15px; + margin-bottom: 10px; + display: block; + border-radius: 5px; + background-color: #f8f8f8; + color: #47266E; + border: 1px solid #f0f0f0; + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; + transition: .2s ease-in-out; +} + +.entry-detail:target .signature { + background-color: #D5CAE3; + border: 1px solid #624288; +} + +.entry-detail .signature .method-permalink { + position: absolute; + top: 0; + left: -35px; + padding: 5px 15px; + text-decoration: none; + font-weight: bold; + color: #624288; + opacity: .4; + transition: opacity .2s; +} + +.entry-detail .signature .method-permalink:hover { + opacity: 1; +} + +.entry-detail:target .signature .method-permalink { + opacity: 1; +} + +.methods-inherited { + padding-right: 10%; + line-height: 1.5em; +} + +.methods-inherited h3 { + margin-bottom: 4px; +} + +.methods-inherited a { + display: inline-block; + text-decoration: none; + color: #47266E; +} + +.methods-inherited a:hover { + text-decoration: underline; + color: #6C518B; +} + +.methods-inherited .tooltip>span { + background: #D5CAE3; + padding: 4px 8px; + border-radius: 3px; + margin: -4px -8px; +} + +.methods-inherited .tooltip * { + color: #47266E; +} + +pre { + padding: 10px 20px; + margin-top: 4px; + border-radius: 3px; + line-height: 1.45; + overflow: auto; + color: #333; + background: #fdfdfd; + font-size: 14px; + border: 1px solid #eee; +} + +code { + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; +} + +:not(pre) > code { + background-color: rgba(40,35,30,0.05); + padding: 0.2em 0.4em; + font-size: 85%; + border-radius: 3px; +} + +span.flag { + padding: 2px 4px 1px; + border-radius: 3px; + margin-right: 3px; + font-size: 11px; + border: 1px solid transparent; +} + +span.flag.orange { + background-color: #EE8737; + color: #FCEBDD; + border-color: #EB7317; +} + +span.flag.yellow { + background-color: #E4B91C; + color: #FCF8E8; + border-color: #B69115; +} + +span.flag.green { + background-color: #469C14; + color: #E2F9D3; + border-color: #34700E; +} + +span.flag.red { + background-color: #BF1919; + color: #F9ECEC; + border-color: #822C2C; +} + +span.flag.purple { + background-color: #2E1052; + color: #ECE1F9; + border-color: #1F0B37; +} + +span.flag.lime { + background-color: #a3ff00; + color: #222222; + border-color: #00ff1e; +} + +.tooltip>span { + position: absolute; + opacity: 0; + display: none; + pointer-events: none; +} + +.tooltip:hover>span { + display: inline-block; + opacity: 1; +} + +.c { + color: #969896; +} + +.n { + color: #0086b3; +} + +.t { + color: #0086b3; +} + +.s { + color: #183691; +} + +.i { + color: #7f5030; +} + +.k { + color: #a71d5d; +} + +.o { + color: #a71d5d; +} + +.m { + color: #795da3; +} + +.hidden { + display: none; +} +.search-results { + font-size: 90%; + line-height: 1.3; +} + +.search-results mark { + color: inherit; + background: transparent; + font-weight: bold; +} +.search-result { + padding: 5px 8px 5px 5px; + cursor: pointer; + border-left: 5px solid transparent; + transform: translateX(-3px); + transition: all .2s, background-color 0s, border .02s; + min-height: 3.2em; +} +.search-result.current { + border-left-color: #ddd; + background-color: rgba(200,200,200,0.4); + transform: translateX(0); + transition: all .2s, background-color .5s, border 0s; +} +.search-result.current:hover, +.search-result.current:focus { + border-left-color: #866BA6; +} +.search-result:not(.current):nth-child(2n) { + background-color: rgba(255,255,255,.06); +} +.search-result__title { + font-size: 105%; + word-break: break-all; + line-height: 1.1; + padding: 3px 0; +} +.search-result__title strong { + font-weight: normal; +} +.search-results .search-result__title > a { + padding: 0; + display: block; +} +.search-result__title > a > .args { + color: #dddddd; + font-weight: 300; + transition: inherit; + font-size: 88%; + line-height: 1.2; + letter-spacing: -.02em; +} +.search-result__title > a > .args * { + color: inherit; +} + +.search-result a, +.search-result a:hover { + color: inherit; +} +.search-result:not(.current):hover .search-result__title > a, +.search-result:not(.current):focus .search-result__title > a, +.search-result__title > a:focus { + color: #866BA6; +} +.search-result:not(.current):hover .args, +.search-result:not(.current):focus .args { + color: #6a5a7d; +} + +.search-result__type { + color: #e8e8e8; + font-weight: 300; +} +.search-result__doc { + color: #bbbbbb; + font-size: 90%; +} +.search-result__doc p { + margin: 0; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + line-height: 1.2em; + max-height: 2.4em; +} + +.js-modal-visible .modal-background { + display: flex; +} +.main-content { + position: relative; +} +.modal-background { + position: absolute; + display: none; + height: 100%; + width: 100%; + background: rgba(120,120,120,.4); + z-index: 100; + align-items: center; + justify-content: center; +} +.usage-modal { + max-width: 90%; + background: #fff; + border: 2px solid #ccc; + border-radius: 9px; + padding: 5px 15px 20px; + min-width: 50%; + color: #555; + position: relative; + transform: scale(.5); + transition: transform 200ms; +} +.js-modal-visible .usage-modal { + transform: scale(1); +} +.usage-modal > .close-button { + position: absolute; + right: 15px; + top: 8px; + color: #aaa; + font-size: 27px; + cursor: pointer; +} +.usage-modal > .close-button:hover { + text-shadow: 2px 2px 2px #ccc; + color: #999; +} +.modal-title { + margin: 0; + text-align: center; + font-weight: normal; + color: #666; + border-bottom: 2px solid #ddd; + padding: 10px; +} +.usage-list { + padding: 0; + margin: 13px; +} +.usage-list > li { + padding: 5px 2px; + overflow: auto; + padding-left: 100px; + min-width: 12em; +} +.usage-modal kbd { + background: #eee; + border: 1px solid #ccc; + border-bottom-width: 2px; + border-radius: 3px; + padding: 3px 8px; + font-family: monospace; + margin-right: 2px; + display: inline-block; +} +.usage-key { + float: left; + clear: left; + margin-left: -100px; + margin-right: 12px; +} +.doc-inherited { + font-weight: bold; +} + +.anchor { + float: left; + padding-right: 4px; + margin-left: -20px; +} + +.main-content .anchor .octicon-link { + width: 16px; + height: 16px; +} + +.main-content .anchor:focus { + outline: none +} + +.main-content h1:hover .anchor, +.main-content h2:hover .anchor, +.main-content h3:hover .anchor, +.main-content h4:hover .anchor, +.main-content h5:hover .anchor, +.main-content h6:hover .anchor { + text-decoration: none +} + +.main-content h1 .octicon-link, +.main-content h2 .octicon-link, +.main-content h3 .octicon-link, +.main-content h4 .octicon-link, +.main-content h5 .octicon-link, +.main-content h6 .octicon-link { + visibility: hidden +} + +.main-content h1:hover .anchor .octicon-link, +.main-content h2:hover .anchor .octicon-link, +.main-content h3:hover .anchor .octicon-link, +.main-content h4:hover .anchor .octicon-link, +.main-content h5:hover .anchor .octicon-link, +.main-content h6:hover .anchor .octicon-link { + visibility: visible +} + +img { + max-width: 100%; +} + +table { + font-size: 14px; + display: block; + max-width: -moz-fit-content; + max-width: fit-content; + overflow-x: auto; + white-space: nowrap; + background: #fdfdfd; + text-align: center; + border: 1px solid #eee; + border-collapse: collapse; + padding: 0px 5px 0px 5px; +} + +table th { + padding: 10px; + letter-spacing: 1px; + border-bottom: 1px solid #eee; +} + +table td { + padding: 10px; +} + +#sidebar-btn { + height: 32px; + width: 32px; +} + +#sidebar-btn-label { + height: 2em; + width: 2em; +} + +#sidebar-btn, #sidebar-btn-label { + display: none; + margin: .7rem; + appearance: none; + color: black; + cursor: pointer; +} + +@media only screen and (max-width: 635px) { + .sidebar, .main-content { + /* svg size + vertical margin - .search-box padding-top */ + padding-top: calc(2em + 2 * 0.7rem - 13px); + } + + #sidebar-btn, #sidebar-btn-label { + display: block; + position: absolute; + z-index: 50; + transition-duration: 200ms; + left: 0; + } + + #sidebar-btn:not(:checked) ~ #sidebar-btn-label > .close, + #sidebar-btn:checked ~ #sidebar-btn-label > .open, + #sidebar-btn:checked ~ .main-content { + display: none; + } + + #sidebar-btn:checked { + left: calc(100% - 32px - (2 * 0.7rem)); + } + + #sidebar-btn:checked ~ #sidebar-btn-label { + color: white; + /* 100% - svg size - horizontal margin */ + left: calc(100% - 2em - (2 * 0.7rem)); + } + + #sidebar-btn~.sidebar { + width: 0%; + } + + #sidebar-btn:checked~.sidebar { + visibility: visible; + width: 100%; + } + + .sidebar { + transition-duration: 200ms; + max-width: 100vw; + visibility: hidden; + } +} + +@media (prefers-color-scheme: dark) { + html, body { + background: #1b1b1b; + } + + body { + color: white; + } + + a { + color: #8cb4ff; + } + + .main-content a:visited { + color: #5f8de3; + } + + h1, h2, h3, h4, h5, h6 { + color: white; + } + + h1.type-name { + color: white; + background-color: #202020; + border: 1px solid #353535; + } + + .project-versions-nav > option { + background-color: #222; + } + + .superclass-hierarchy .superclass a, + .superclass-hierarchy .superclass a:visited, + .other-type a, + .other-type a:visited, + .entry-summary .signature, + .entry-summary a:visited { + background-color: #202020; + color: white; + border: 1px solid #353535; + } + + .superclass-hierarchy .superclass a:hover, + .other-type a:hover, + .entry-summary .signature:hover { + background: #443d4d; + border-color: #b092d4; + } + + .kind { + color: #b092d4; + } + + .n { + color: #00ade6; + } + + .t { + color: #00ade6; + } + + .k { + color: #ff66ae; + } + + .o { + color: #ff66ae; + } + + .s { + color: #7799ff; + } + + .i { + color: #b38668; + } + + .m { + color: #b9a5d6; + } + + .c { + color: #a1a1a1; + } + + .methods-inherited a, .methods-inherited a:visited { + color: #B290D9; + } + + .methods-inherited a:hover { + color: #D4B7F4; + } + + .methods-inherited .tooltip>span { + background: #443d4d; + } + + .methods-inherited .tooltip * { + color: white; + } + + .entry-detail:target .signature { + background-color: #443d4d; + border: 1px solid #b092d4; + } + + .entry-detail .signature { + background-color: #202020; + color: white; + border: 1px solid #353535; + } + + .entry-detail .signature .method-permalink { + color: #b092d4; + } + + :not(pre)>code { + background-color: #202020; + } + + span.flag.purple { + background-color: #443d4d; + color: #ECE1F9; + border-color: #b092d4; + } + + .sidebar input::-webkit-input-placeholder { /* Chrome/Opera/Safari */ + color: white; + } + + .sidebar input::-moz-placeholder { /* Firefox 19+ */ + color: white; + } + + .sidebar input:-ms-input-placeholder { /* IE 10+ */ + color: white; + } + + .sidebar input:-moz-placeholder { /* Firefox 18- */ + color: white; + } + + pre, + table { + color: white; + background: #202020; + border: 1px solid #353535; + } + + table th { + border-bottom: 1px solid #353535; + } + + #sidebar-btn, #sidebar-btn-label { + color: white; + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..52c507b --- /dev/null +++ b/index.html @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + geojson 0.5.0 + + + + + + + + + + +
+

+GeoJSON

+

Crystal CI +Docs +License

+

Crystal library for reading and writing GeoJSON

+

This library contains:

+ +

+ +Installation

+

Add the dependency to your shard.yml:

+
dependencies:
+  geojson:
+    github: geocrystal/geojson
+

and run shards install

+
require "geojson"
+

+ +Position

+

A position is the fundamental geometry construct. The coordinates member of a Geometry object is composed of either:

+ +

A position is an array of Float64.

+

There must be two or more elements. The first two elements are longitude and latitude. Altitude may be included as an optional third element.

+
postition = [-80.1347334, 25.7663562, 0.0]
+point = GeoJSON::Point.new(position)
+

+ +GeoJSON types

+

+ +Point

+

A GeoJSON point looks like this:

+
{
+  "type": "Point",
+  "coordinates": [-80.1347334, 25.7663562]
+}
+

It is important to note that coordinates is in the format [longitude, latitude]. +Longitude comes before latitude in GeoJSON.

+

For type Point, the coordinates member is a single position.

+

Serialize geometry type:

+
point = GeoJSON::Point.new([-80.1347334, 25.7663562])
+json = point.to_json
+# => {"type":"Point","coordinates":[-80.1347334,25.7663562]}
+

Deserialize geometry type:

+
point = GeoJSON::Point.from_json(json)
+# => #<GeoJSON::Point:0x7f1444af9920>
+point.longitude
+# => -80.1347334
+point.latitude
+# => 25.7663562
+

+ +MultiPoint

+

For type MultiPoint, the coordinates member is an array of positions.

+
point1 = GeoJSON::Point.new(longitude: 100.0, latitude: 0.0)
+point2 = GeoJSON::Point.new(longitude: 101.0, latitude: 1.0)
+
+multi_point = GeoJSON::MultiPoint.new([point1, point2])
+multi_point.to_json
+
{
+  "type":"MultiPoint",
+  "coordinates":[[100.0, 0.0], [101.0, 1.0]]
+}
+

+ +LineString

+

For type LineString, the coordinates member is an array of two or more positions.

+
line_string = GeoJSON::LineString.new [[-124.2, 42.0], [-120.0, 42.0]]
+line_string.to_json
+
{
+  "type": "LineString",
+  "coordinates": [[-124.2, 42.0], [-120.0, 42.0]]
+}
+

+ +MultiLineString

+

For type MultiLineString, the coordinates member is an array of LineString coordinate arrays.

+
line_string1 = GeoJSON::LineString.new([[100.0, 0.0], [101.0, 1.0]])
+line_string2 = GeoJSON::LineString.new([[102.0, 2.0], [103.0, 3.0]])
+
+multi_line_string = GeoJSON::MultiLineString.new([line_string1, line_string2])
+
multi_line_string = GeoJSON::MultiLineString.new([
+  [[100.0, 0.0], [101.0, 1.0]],
+  [[102.0, 2.0], [103.0, 3.0]],
+])
+multi_line_string.to_json
+
{
+  "type":"MultiLineString",
+  "coordinates":[
+    [
+      [100.0, 0.0],
+      [101.0, 1.0]
+    ],
+    [
+      [102.0, 2.0],
+      [103.0, 3.0]
+    ]
+  ]
+}
+

+ +Polygon

+

GeoJSON polygons represent closed shapes on a map, like triangles, squares, dodecagons, or any shape with a fixed number of sides.

+

To specify a constraint specific to Polygon, it is useful to introduce the concept of a linear ring:

+ +

The Polygon geometry type definition as follows:

+ +
polygon = GeoJSON::Polygon.new([
+  [[-10.0, -10.0], [10.0, -10.0], [10.0, 10.0], [-10.0,-10.0]],
+  [[-1.0, -2.0], [3.0, -2.0], [3.0, 2.0], [-1.0,-2.0]]
+])
+polygon.to_json
+
{
+  "type": "Polygon",
+  "coordinates": [
+    [
+      [-10.0, -10.0],
+      [10.0, -10.0],
+      [10.0,10.0],
+      [-10.0,-10.0]
+    ],
+    [
+      [-1.0, -2.0],
+      [3.0, -2.0],
+      [3.0, 2.0],
+      [-1.0,-2.0]
+    ]
+  ]
+}
+

+ +MultiPolygon

+

For type MultiPolygon, the coordinates member is an array of Polygon coordinate arrays.

+
polygon1 = GeoJSON::Polygon.new(
+  [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]]
+)
+polygon2 = GeoJSON::Polygon.new(
+  [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]
+)
+
+multi_polygon = GeoJSON::MultiPolygon.new([polygon1, polygon2])
+multi_polygon.to_json
+
{
+  "type":"MultiPolygon",
+  "coordinates":[
+    [
+      [
+        [102.0,2.0],
+        [103.0,2.0],
+        [103.0,3.0],
+        [102.0,3.0],
+        [102.0,2.0]
+      ]
+    ],
+    [
+      [
+        [100.0,0.0],
+        [101.0,0.0],
+        [101.0,1.0],
+        [100.0,1.0],
+        [100.0,0.0]
+      ]
+    ]
+  ]
+}
+

+ +GeometryCollection

+

A GeoJSON object with type GeometryCollection is a Geometry object.

+

A GeometryCollection has a member with the name geometries. The +value of geometries is an array. Each element of this array is a +GeoJSON Geometry object.

+
point = GeoJSON::Point.new([100.0, 0.0])
+line_string = GeoJSON::LineString.new([
+  [101.0, 0.0],
+  [102.0, 1.0],
+])
+polygon = GeoJSON::Polygon.new([
+  [
+    [100.0, 0.0],
+    [101.0, 0.0],
+    [101.0, 1.0],
+    [100.0, 1.0],
+    [100.0, 0.0],
+  ],
+])
+
+geometry_collection = GeoJSON::GeometryCollection.new([point, line_string, polygon])
+geometry_collection.to_json
+
{
+  "type":"GeometryCollection",
+  "geometries":[
+    {
+      "type":"Point",
+      "coordinates":[100.0,0.0]
+    },
+    {
+      "type":"LineString",
+      "coordinates":[
+        [101.0,0.0],
+        [102.0,1.0]
+      ]
+    },
+    {
+      "type":"Polygon",
+      "coordinates":[
+        [
+          [100.0,0.0],
+          [101.0,0.0],
+          [101.0,1.0],
+          [100.0,1.0],
+          [100.0,0.0]
+        ]
+      ]
+    }
+  ]
+}
+

+ +Feature

+

A Feature object represents a spatially bounded thing. Every Feature object is a GeoJSON object no matter where it occurs in a GeoJSON text.

+ +
point = GeoJSON::Point.new([-80.1347334, 25.7663562])
+properties = {"color" => "red"} of String => JSON::Any::Type
+feature = GeoJSON::Feature.new(point, properties, id: 1)
+feature.to_json
+
{
+  "type":"Feature",
+  "geometry":{
+    "type":"Point",
+    "coordinates":[-80.1347334,25.7663562]
+  },
+  "properties":{
+    "color":"red"
+  },
+  "id":1
+}
+

+ +FeatureCollection

+

A GeoJSON object with the type "FeatureCollection" is a FeatureCollection object. A FeatureCollection object has a member with the name "features". The value of "features" is a JSON array. Each element of the array is a Feature object. It is possible for this array to be empty.

+
feature1 = GeoJSON::Feature.new(
+  GeoJSON::Point.new([102.0, 0.5]),
+  id: "point"
+)
+
+feature2 = GeoJSON::Feature.new(
+  GeoJSON::Polygon.new([
+    [
+      [100.0, 0.0],
+      [101.0, 0.0],
+      [101.0, 1.0],
+      [100.0, 1.0],
+      [100.0, 0.0],
+    ],
+  ]),
+  type: "polygon"
+)
+
+feature_collection = GeoJSON::FeatureCollection.new([feature1, feature2])
+feature_collection.to_json
+
{
+  "type":"FeatureCollection",
+  "features":[
+    {
+      "type":"Feature",
+      "geometry":{
+        "type":"Point",
+        "coordinates":[102.0,0.5]
+      },
+      "properties":null,
+      "id":"point"
+    },
+    {
+      "type":"Feature",
+      "geometry":{
+        "type":"Polygon",
+        "coordinates":[
+          [
+            [100.0,0.0],
+            [101.0,0.0],
+            [101.0,1.0],
+            [100.0,1.0],
+            [100.0,0.0]
+          ]
+        ]
+      },
+      "properties":null,
+      "id":"polygon"
+    }
+  ]
+}
+

+ +Foreign Members

+

For example, in the Point object shown below

+
{
+  "type": "Point",
+  "coordinates": [-80.1347334, 25.7663562],
+  "title": "Example Point"
+}
+

the name/value pair of "title": "Example Point" is a foreign member.

+

GeoJSON semantics do not apply to foreign members and their descendants, regardless of their names and values.

+

If the GeoJSON type include foreign members, this properties in the JSON document will be stored in a Hash(String, JSON::Any). +On serialization, any keys inside json_unmapped will be serialized and appended to the current json object.

+
point = GeoJSON::Point.new([-80.1347334, 25.7663562])
+
+json_unmapped = Hash(String, JSON::Any).new
+json_unmapped["title"] = JSON::Any.new("Example Point")
+
+point.json_unmapped = json_unmapped
+

+ +Contributing

+
    +
  1. Fork it (https://github.com/geocrystal/geojson/fork)
  2. +
  3. Create your feature branch (git checkout -b my-new-feature)
  4. +
  5. Commit your changes (git commit -am 'Add some feature')
  6. +
  7. Push to the branch (git push origin my-new-feature)
  8. +
  9. Create a new Pull Request
  10. +
+

+ +Contributors

+ +

+ +License

+

Copyright: 2020-2022 Anton Maminov (anton.maminov@gmail.com)

+

This library is distributed under the MIT license. Please see the LICENSE file.

+
+ + diff --git a/index.json b/index.json new file mode 100644 index 0000000..bb6ec44 --- /dev/null +++ b/index.json @@ -0,0 +1 @@ +{"repository_name":"geojson","body":"# GeoJSON\n\n[![Crystal CI](https://github.com/geocrystal/geojson/actions/workflows/crystal.yml/badge.svg)](https://github.com/geocrystal/geojson/actions/workflows/crystal.yml)\n[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://geocrystal.github.io/geojson/)\n[![License](https://img.shields.io/github/license/geocrystal/geojson.svg)](https://github.com/geocrystal/geojson/blob/master/LICENSE)\n\nCrystal library for reading and writing [GeoJSON](https://tools.ietf.org/html/rfc7946)\n\nThis library contains:\n\n- Functions for encoding and decoding GeoJSON formatted data\n- Classes for all GeoJSON Objects\n- Allow \"foreign members\" in a GeoJSON Objects\n\n## Installation\n\nAdd the dependency to your `shard.yml`:\n\n```yaml\ndependencies:\n geojson:\n github: geocrystal/geojson\n```\n\nand run `shards install`\n\n```crystal\nrequire \"geojson\"\n```\n\n## Position\n\nA position is the fundamental geometry construct. The `coordinates` member of a Geometry object is composed of either:\n\n- one position in the case of a `Point` geometry\n- an array of positions in the case of a `LineString` or `MultiPoint` geometry\n- an array of `LineString` or linear ring coordinates in the case of a `Polygon` or `MultiLineString` geometry\n- an array of `Polygon` coordinates in the case of a `MultiPolygon` geometry\n\nA position is an array of `Float64`.\n\nThere __must__ be two or more elements. The first two elements are `longitude` and `latitude`. `Altitude` __may__ be included as an optional third element.\n\n```crystal\npostition = [-80.1347334, 25.7663562, 0.0]\npoint = GeoJSON::Point.new(position)\n```\n\n## GeoJSON types\n\n### Point\n\nA GeoJSON point looks like this:\n\n```json\n{\n \"type\": \"Point\",\n \"coordinates\": [-80.1347334, 25.7663562]\n}\n```\n\nIt is important to note that coordinates is in the format `[longitude, latitude]`.\nLongitude comes before latitude in GeoJSON.\n\nFor type `Point`, the `coordinates` member is a single position.\n\nSerialize geometry type:\n\n```crystal\npoint = GeoJSON::Point.new([-80.1347334, 25.7663562])\njson = point.to_json\n# => {\"type\":\"Point\",\"coordinates\":[-80.1347334,25.7663562]}\n```\n\nDeserialize geometry type:\n\n```crystal\npoint = GeoJSON::Point.from_json(json)\n# => #\npoint.longitude\n# => -80.1347334\npoint.latitude\n# => 25.7663562\n```\n\n### MultiPoint\n\nFor type `MultiPoint`, the `coordinates` member is an array of positions.\n\n```crystal\npoint1 = GeoJSON::Point.new(longitude: 100.0, latitude: 0.0)\npoint2 = GeoJSON::Point.new(longitude: 101.0, latitude: 1.0)\n\nmulti_point = GeoJSON::MultiPoint.new([point1, point2])\nmulti_point.to_json\n```\n\n```json\n{\n \"type\":\"MultiPoint\",\n \"coordinates\":[[100.0, 0.0], [101.0, 1.0]]\n}\n```\n\n### LineString\n\nFor type `LineString`, the `coordinates` member is an array of two or more positions.\n\n```crystal\nline_string = GeoJSON::LineString.new [[-124.2, 42.0], [-120.0, 42.0]]\nline_string.to_json\n```\n\n```json\n{\n \"type\": \"LineString\",\n \"coordinates\": [[-124.2, 42.0], [-120.0, 42.0]]\n}\n```\n\n### MultiLineString\n\nFor type `MultiLineString`, the `coordinates` member is an array of `LineString` coordinate arrays.\n\n```crystal\nline_string1 = GeoJSON::LineString.new([[100.0, 0.0], [101.0, 1.0]])\nline_string2 = GeoJSON::LineString.new([[102.0, 2.0], [103.0, 3.0]])\n\nmulti_line_string = GeoJSON::MultiLineString.new([line_string1, line_string2])\n```\n\n```crystal\nmulti_line_string = GeoJSON::MultiLineString.new([\n [[100.0, 0.0], [101.0, 1.0]],\n [[102.0, 2.0], [103.0, 3.0]],\n])\nmulti_line_string.to_json\n```\n\n```json\n{\n \"type\":\"MultiLineString\",\n \"coordinates\":[\n [\n [100.0, 0.0],\n [101.0, 1.0]\n ],\n [\n [102.0, 2.0],\n [103.0, 3.0]\n ]\n ]\n}\n```\n\n### Polygon\n\nGeoJSON polygons represent closed shapes on a map, like triangles, squares, dodecagons, or any shape with a fixed number of sides.\n\nTo specify a constraint specific to `Polygon`, it is useful to introduce the concept of a linear ring:\n\n- A linear ring is a closed `LineString` with four or more positions.\n- The first and last positions are equivalent, and they __must__ contain identical values; their representation __should__ also be identical.\n- A linear ring is the boundary of a surface or the boundary of a hole in a surface.\n- A linear ring __must__ follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.\n\nThe `Polygon` geometry type definition as follows:\n\n- For type `Polygon`, the `coordinates` member __must__ be an array of linear ring coordinate arrays.\n- For `Polygon` with more than one of these rings, the first __must__ be the exterior ring, and any others __must__ be interior rings. The exterior ring bounds the surface, and the interior rings (if present) bound holes within the surface.\n\n```crystal\npolygon = GeoJSON::Polygon.new([\n [[-10.0, -10.0], [10.0, -10.0], [10.0, 10.0], [-10.0,-10.0]],\n [[-1.0, -2.0], [3.0, -2.0], [3.0, 2.0], [-1.0,-2.0]]\n])\npolygon.to_json\n```\n\n```json\n{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [-10.0, -10.0],\n [10.0, -10.0],\n [10.0,10.0],\n [-10.0,-10.0]\n ],\n [\n [-1.0, -2.0],\n [3.0, -2.0],\n [3.0, 2.0],\n [-1.0,-2.0]\n ]\n ]\n}\n```\n\n### MultiPolygon\n\nFor type `MultiPolygon`, the `coordinates` member is an array of `Polygon` coordinate arrays.\n\n```crystal\npolygon1 = GeoJSON::Polygon.new(\n [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]]\n)\npolygon2 = GeoJSON::Polygon.new(\n [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]\n)\n\nmulti_polygon = GeoJSON::MultiPolygon.new([polygon1, polygon2])\nmulti_polygon.to_json\n```\n\n```json\n{\n \"type\":\"MultiPolygon\",\n \"coordinates\":[\n [\n [\n [102.0,2.0],\n [103.0,2.0],\n [103.0,3.0],\n [102.0,3.0],\n [102.0,2.0]\n ]\n ],\n [\n [\n [100.0,0.0],\n [101.0,0.0],\n [101.0,1.0],\n [100.0,1.0],\n [100.0,0.0]\n ]\n ]\n ]\n}\n```\n\n### GeometryCollection\n\nA GeoJSON object with type `GeometryCollection` is a Geometry object.\n\nA `GeometryCollection` has a member with the name `geometries`. The\nvalue of `geometries` is an array. Each element of this array is a\nGeoJSON Geometry object.\n\n```crystal\npoint = GeoJSON::Point.new([100.0, 0.0])\nline_string = GeoJSON::LineString.new([\n [101.0, 0.0],\n [102.0, 1.0],\n])\npolygon = GeoJSON::Polygon.new([\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n])\n\ngeometry_collection = GeoJSON::GeometryCollection.new([point, line_string, polygon])\ngeometry_collection.to_json\n```\n\n```json\n{\n \"type\":\"GeometryCollection\",\n \"geometries\":[\n {\n \"type\":\"Point\",\n \"coordinates\":[100.0,0.0]\n },\n {\n \"type\":\"LineString\",\n \"coordinates\":[\n [101.0,0.0],\n [102.0,1.0]\n ]\n },\n {\n \"type\":\"Polygon\",\n \"coordinates\":[\n [\n [100.0,0.0],\n [101.0,0.0],\n [101.0,1.0],\n [100.0,1.0],\n [100.0,0.0]\n ]\n ]\n }\n ]\n}\n```\n\n### Feature\n\nA `Feature` object represents a spatially bounded thing. Every `Feature` object is a GeoJSON object no matter where it occurs in a GeoJSON text.\n\n- A `Feature` object has a `\"type\"` member with the value `\"Feature\"`.\n- A `Feature` object has a member with the name `\"geometry\"`. The value of the geometry member __shall__ be either a Geometry object as defined above or, in the case that the `Feature` is unlocated, a JSON `null` value.\n- A `Feature` object has a member with the name `\"properties\"`. The value of the properties member is an object (any JSON object or a JSON `null` value).\n- If a `Feature` has a commonly used identifier, that identifier __should__ be included as a member of the `Feature` object with the name `\"id\"`, and the value of this member is either a JSON string or number.\n\n```crystal\npoint = GeoJSON::Point.new([-80.1347334, 25.7663562])\nproperties = {\"color\" => \"red\"} of String => JSON::Any::Type\nfeature = GeoJSON::Feature.new(point, properties, id: 1)\nfeature.to_json\n```\n\n```json\n{\n \"type\":\"Feature\",\n \"geometry\":{\n \"type\":\"Point\",\n \"coordinates\":[-80.1347334,25.7663562]\n },\n \"properties\":{\n \"color\":\"red\"\n },\n \"id\":1\n}\n```\n\n### FeatureCollection\n\nA GeoJSON object with the type `\"FeatureCollection\"` is a `FeatureCollection` object. A `FeatureCollection` object has a member with the name `\"features\"`. The value of `\"features\"` is a JSON array. Each element of the array is a `Feature` object. It is possible for this array to be empty.\n\n```crystal\nfeature1 = GeoJSON::Feature.new(\n GeoJSON::Point.new([102.0, 0.5]),\n id: \"point\"\n)\n\nfeature2 = GeoJSON::Feature.new(\n GeoJSON::Polygon.new([\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n ]),\n type: \"polygon\"\n)\n\nfeature_collection = GeoJSON::FeatureCollection.new([feature1, feature2])\nfeature_collection.to_json\n```\n\n```json\n{\n \"type\":\"FeatureCollection\",\n \"features\":[\n {\n \"type\":\"Feature\",\n \"geometry\":{\n \"type\":\"Point\",\n \"coordinates\":[102.0,0.5]\n },\n \"properties\":null,\n \"id\":\"point\"\n },\n {\n \"type\":\"Feature\",\n \"geometry\":{\n \"type\":\"Polygon\",\n \"coordinates\":[\n [\n [100.0,0.0],\n [101.0,0.0],\n [101.0,1.0],\n [100.0,1.0],\n [100.0,0.0]\n ]\n ]\n },\n \"properties\":null,\n \"id\":\"polygon\"\n }\n ]\n}\n```\n\n## Foreign Members\n\nFor example, in the `Point` object shown below\n\n```json\n{\n \"type\": \"Point\",\n \"coordinates\": [-80.1347334, 25.7663562],\n \"title\": \"Example Point\"\n}\n```\n\nthe name/value pair of `\"title\": \"Example Point\"` is a foreign member.\n\nGeoJSON semantics do not apply to foreign members and their descendants, regardless of their names and values.\n\nIf the GeoJSON type include foreign members, this properties in the JSON document will be stored in a `Hash(String, JSON::Any)`.\nOn serialization, any keys inside `json_unmapped` will be serialized and appended to the current json object.\n\n```crystal\npoint = GeoJSON::Point.new([-80.1347334, 25.7663562])\n\njson_unmapped = Hash(String, JSON::Any).new\njson_unmapped[\"title\"] = JSON::Any.new(\"Example Point\")\n\npoint.json_unmapped = json_unmapped\n```\n\n## Contributing\n\n1. Fork it ()\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer\n\n## License\n\nCopyright: 2020-2022 Anton Maminov (anton.maminov@gmail.com)\n\nThis library is distributed under the MIT license. Please see the LICENSE file.\n","program":{"html_id":"geojson/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"geojson","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"geojson/GeoJSON","path":"GeoJSON.html","kind":"module","full_name":"GeoJSON","name":"GeoJSON","abstract":false,"locations":[{"filename":"src/geojson.cr","line_number":15,"url":null},{"filename":"src/geojson/coordinates.cr","line_number":1,"url":null},{"filename":"src/geojson/exception.cr","line_number":1,"url":null},{"filename":"src/geojson/feature.cr","line_number":3,"url":null},{"filename":"src/geojson/feature_collection.cr","line_number":1,"url":null},{"filename":"src/geojson/geometry_collection.cr","line_number":1,"url":null},{"filename":"src/geojson/line_string.cr","line_number":1,"url":null},{"filename":"src/geojson/multi_line_string.cr","line_number":1,"url":null},{"filename":"src/geojson/multi_point.cr","line_number":1,"url":null},{"filename":"src/geojson/multi_polygon.cr","line_number":1,"url":null},{"filename":"src/geojson/object.cr","line_number":1,"url":null},{"filename":"src/geojson/point.cr","line_number":1,"url":null},{"filename":"src/geojson/polygon.cr","line_number":1,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /__w/geojson/geojson/src`).chomp.stringify }}"}],"types":[{"html_id":"geojson/GeoJSON/Coordinates","path":"GeoJSON/Coordinates.html","kind":"class","full_name":"GeoJSON::Coordinates","name":"Coordinates","abstract":false,"superclass":{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/coordinates.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Coordinates` is a position in longitude, latitude, and (optionally)\naltitude.\n\nThis class corresponds to the [GeoJSON Position](https://tools.ietf.org/html/rfc7946#section-3.1.1).","summary":"

A Coordinates is a position in longitude, latitude, and (optionally) altitude.

","constructors":[{"html_id":"new(longitude:Float64,latitude:Float64,altitude:Float64|Nil=nil)-class-method","name":"new","doc":"Creates a new `Coordinates` with the given *longitude*, *latitude* and *altitude*.","summary":"

Creates a new Coordinates with the given longitude, latitude and altitude.

","abstract":false,"args":[{"name":"longitude","external_name":"longitude","restriction":"Float64"},{"name":"latitude","external_name":"latitude","restriction":"Float64"},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":"Float64 | ::Nil"}],"args_string":"(longitude : Float64, latitude : Float64, altitude : Float64 | Nil = nil)","args_html":"(longitude : Float64, latitude : Float64, altitude : Float64 | Nil = nil)","location":{"filename":"src/geojson/coordinates.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"longitude","external_name":"longitude","restriction":"Float64"},{"name":"latitude","external_name":"latitude","restriction":"Float64"},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":"Float64 | ::Nil"}],"visibility":"Public","body":"if altitude\n new([longitude, latitude, altitude])\nelse\n new([longitude, latitude])\nend"}},{"html_id":"new(coordinates:Array(Float64))-class-method","name":"new","doc":"Creates a new `Coordinates` with the given *coordinates* array.","summary":"

Creates a new Coordinates with the given coordinates array.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"}],"args_string":"(coordinates : Array(Float64))","args_html":"(coordinates : Array(Float64))","location":{"filename":"src/geojson/coordinates.cr","line_number":10,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(parser:JSON::PullParser)-class-method","name":"new","doc":"Deserializes a `Coordinates` from the given JSON *parser*.","summary":"

Deserializes a Coordinates from the given JSON parser.

","abstract":false,"args":[{"name":"parser","external_name":"parser","restriction":"JSON::PullParser"}],"args_string":"(parser : JSON::PullParser)","args_html":"(parser : JSON::PullParser)","location":{"filename":"src/geojson/coordinates.cr","line_number":15,"url":null},"def":{"name":"new","args":[{"name":"parser","external_name":"parser","restriction":"JSON::PullParser"}],"visibility":"Public","body":"coordinates = Array(Float64).new(parser)\nnew(coordinates)\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

Returns true if this reference is the same as other.

","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif coordinates == other.coordinates\nelse\n return false\nend\ntrue\n"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/coordinates.cr","line_number":30,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/coordinates.cr","line_number":30,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"altitude-instance-method","name":"altitude","doc":"Gets this Coordinates' altitude.\n\nTechnically, this positional value is meant to be the height in meters\nabove the WGS84 ellipsoid.","summary":"

Gets this Coordinates' altitude.

","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":46,"url":null},"def":{"name":"altitude","visibility":"Public","body":"coordinates[2]?"}},{"html_id":"coordinates:Array(Float64)-instance-method","name":"coordinates","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":7,"url":null},"def":{"name":"coordinates","return_type":"Array(Float64)","visibility":"Public","body":"@coordinates"}},{"html_id":"hash(hasher)-instance-method","name":"hash","doc":"See `Object#hash(hasher)`","summary":"

See Object#hash(hasher)

","abstract":false,"args":[{"name":"hasher","external_name":"hasher","restriction":""}],"args_string":"(hasher)","args_html":"(hasher)","def":{"name":"hash","args":[{"name":"hasher","external_name":"hasher","restriction":""}],"visibility":"Public","body":"hasher = coordinates.hash(hasher)\nhasher\n"}},{"html_id":"latitude-instance-method","name":"latitude","doc":"Gets this Coordinates' latitude in decimal degrees according to WGS84.","summary":"

Gets this Coordinates' latitude in decimal degrees according to WGS84.

","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":38,"url":null},"def":{"name":"latitude","visibility":"Public","body":"coordinates[1]"}},{"html_id":"longitude-instance-method","name":"longitude","doc":"Gets this Coordinates' longitude in decimal degrees according to WGS84.","summary":"

Gets this Coordinates' longitude in decimal degrees according to WGS84.

","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":33,"url":null},"def":{"name":"longitude","visibility":"Public","body":"coordinates[0]"}},{"html_id":"to_json(*args,**options)-instance-method","name":"to_json","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/coordinates.cr","line_number":56,"url":null},"def":{"name":"to_json","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.to_json(*args, **options)"}},{"html_id":"to_json(*args,**options,&)-instance-method","name":"to_json","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/coordinates.cr","line_number":56,"url":null},"def":{"name":"to_json","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.to_json(*args, **options) do |*yield_args|\n yield *yield_args\nend"}}]},{"html_id":"geojson/GeoJSON/Exception","path":"GeoJSON/Exception.html","kind":"class","full_name":"GeoJSON::Exception","name":"Exception","abstract":false,"superclass":{"html_id":"geojson/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"geojson/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/exception.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"Raised when an attempt is made to create a GeoJSON object that is malformed.\n\nIn most cases, this means that the given coordinates for a geometry object\ndon't fulfill the requirements for that geometry type.","summary":"

Raised when an attempt is made to create a GeoJSON object that is malformed.

"},{"html_id":"geojson/GeoJSON/Feature","path":"GeoJSON/Feature.html","kind":"class","full_name":"GeoJSON::Feature","name":"Feature","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/feature.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Feature` represents a [GeoJSON Feature object](https://tools.ietf.org/html/rfc7946#section-3.2)\nwith a geometry and properties.","summary":"

A Feature represents a GeoJSON Feature object with a geometry and properties.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `Feature` represents a [GeoJSON Feature object](https://tools.ietf.org/html/rfc7946#section-3.2)\nwith a geometry and properties.","summary":"

A Feature represents a GeoJSON Feature object with a geometry and properties.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/feature.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(geometry:GeoJSON::Object|Nil,properties:Nil|Hash(String,Array(JSON::Any)|Bool|Float64|Hash(String,JSON::Any)|Int64|String|Nil)=nil,*,id:Int32|String|Nil=nil,bbox=nil)-class-method","name":"new","doc":"Creates a new `Feature` with the given *geometry* and optional\n*properties*, *id*, and bounding box *bbox*.","summary":"

Creates a new Feature with the given geometry and optional properties, id, and bounding box bbox.

","abstract":false,"args":[{"name":"geometry","external_name":"geometry","restriction":"::GeoJSON::Object | ::Nil"},{"name":"properties","default_value":"nil","external_name":"properties","restriction":"::Nil | ::Hash(::String, ::Array(::JSON::Any) | ::Bool | ::Float64 | ::Hash(::String, ::JSON::Any) | ::Int64 | ::String | ::Nil)"},{"name":"","external_name":"","restriction":""},{"name":"id","default_value":"nil","external_name":"id","restriction":"::Int32 | ::String | ::Nil"},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(geometry : GeoJSON::Object | Nil, properties : Nil | Hash(String, Array(JSON::Any) | Bool | Float64 | Hash(String, JSON::Any) | Int64 | String | Nil) = nil, *, id : Int32 | String | Nil = nil, bbox = nil)","args_html":"(geometry : GeoJSON::Object | Nil, properties : Nil | Hash(String, Array(JSON::Any) | Bool | Float64 | Hash(String, JSON::Any) | Int64 | String | Nil) = nil, *, id : Int32 | String | Nil = nil, bbox = nil)","location":{"filename":"src/geojson/feature.cr","line_number":23,"url":null},"def":{"name":"new","args":[{"name":"geometry","external_name":"geometry","restriction":"::GeoJSON::Object | ::Nil"},{"name":"properties","default_value":"nil","external_name":"properties","restriction":"::Nil | ::Hash(::String, ::Array(::JSON::Any) | ::Bool | ::Float64 | ::Hash(::String, ::JSON::Any) | ::Int64 | ::String | ::Nil)"},{"name":"","external_name":"","restriction":""},{"name":"id","default_value":"nil","external_name":"id","restriction":"::Int32 | ::String | ::Nil"},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":2,"visibility":"Public","body":"_ = allocate\n_.initialize(geometry, properties, id: id, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":26,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\ngeometry.try(&.bbox)\n"}},{"html_id":"geometry:GeoJSON::Object::Type|Nil-instance-method","name":"geometry","doc":"Gets this Feature's geometry.","summary":"

Gets this Feature's geometry.

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":12,"url":null},"def":{"name":"geometry","return_type":"GeoJSON::Object::Type | ::Nil","visibility":"Public","body":"@geometry"}},{"html_id":"id:String|Int32|Nil-instance-method","name":"id","doc":"Gets this Feature's id.","summary":"

Gets this Feature's id.

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":19,"url":null},"def":{"name":"id","return_type":"String | Int32 | Nil","visibility":"Public","body":"@id"}},{"html_id":"properties:Hash(String,JSON::Any::Type)|Nil-instance-method","name":"properties","doc":"Gets this Feature's properties.","summary":"

Gets this Feature's properties.

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":16,"url":null},"def":{"name":"properties","return_type":"Hash(String, JSON::Any::Type) | ::Nil","visibility":"Public","body":"@properties"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this Feature's GeoJSON type (\"Feature\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/FeatureCollection","path":"GeoJSON/FeatureCollection.html","kind":"class","full_name":"GeoJSON::FeatureCollection","name":"FeatureCollection","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/feature_collection.cr","line_number":4,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `FeatureCollection` represents a [GeoJSON FeatureCollection object](https://tools.ietf.org/html/rfc7946#section-3.3)\nand contains one or more `Feature`s.","summary":"

A FeatureCollection represents a GeoJSON FeatureCollection object and contains one or more Features.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `FeatureCollection` represents a [GeoJSON FeatureCollection object](https://tools.ietf.org/html/rfc7946#section-3.3)\nand contains one or more `Feature`s.","summary":"

A FeatureCollection represents a GeoJSON FeatureCollection object and contains one or more Features.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/feature_collection.cr","line_number":4,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(features:Array(Feature),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `FeatureCollection` with the given *features*.","summary":"

Creates a new FeatureCollection with the given features.

","abstract":false,"args":[{"name":"features","external_name":"features","restriction":"Array(Feature)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(features : Array(Feature), *, bbox = nil)","args_html":"(features : Array(Feature), *, bbox = nil)","location":{"filename":"src/geojson/feature_collection.cr","line_number":12,"url":null},"def":{"name":"new","args":[{"name":"features","external_name":"features","restriction":"Array(Feature)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(features, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature_collection.cr","line_number":15,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\nfeatures.each do |feature|\n feature.bbox.try do |feature_bbox|\n if result[0] > feature_bbox[0]\n result[0] = feature_bbox[0]\n end\n if result[1] > feature_bbox[1]\n result[1] = feature_bbox[1]\n end\n if result[2] < feature_bbox[2]\n result[2] = feature_bbox[2]\n end\n if result[3] < feature_bbox[3]\n result[3] = feature_bbox[3]\n end\n end\nend\nresult\n"}},{"html_id":"features:Array(Feature)-instance-method","name":"features","doc":"Returns this `FeatureCollections` array of features.","summary":"

Returns this FeatureCollections array of features.

","abstract":false,"location":{"filename":"src/geojson/feature_collection.cr","line_number":9,"url":null},"def":{"name":"features","return_type":"Array(Feature)","visibility":"Public","body":"@features"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this FeatureCollection's GeoJSON type (\"FeatureCollection\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature_collection.cr","line_number":6,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/GeometryCollection","path":"GeoJSON/GeometryCollection.html","kind":"class","full_name":"GeoJSON::GeometryCollection","name":"GeometryCollection","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/geometry_collection.cr","line_number":10,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `GeometryCollection` represents a collection of several geometries.\n\nIts array of geometries can contain `Point`, `MultiPoint`, `LineString`,\n`MultiLineString`, `Polygon`, and `MultiPolygon`. Technically, you can nest\n`GeometryCollection`s inside one another, but this is discouraged by the\nspecification.\n\nThis class corresponds to the [GeoJSON GeometryCollection](https://tools.ietf.org/html/rfc7946#section-3.1.8).","summary":"

A GeometryCollection represents a collection of several geometries.

","class_methods":[{"html_id":"read_geometries(pull:JSON::PullParser)-class-method","name":"read_geometries","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/geometry_collection.cr","line_number":39,"url":null},"def":{"name":"read_geometries","args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"visibility":"Public","body":"geometries = [] of GeoJSON::Object::Type\npull.read_begin_array\nwhile !pull.kind.end_array?\n case pull.kind\n when .begin_object?\n if geometry = GeoJSON::Object.new(pull)\n geometries << geometry\n end\n else\n pull.read_next\n end\nend\ngeometries\n"}}],"constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"Deserializes a `GeometryCollection` from the given JSON *parser*.","summary":"

Deserializes a GeometryCollection from the given JSON parser.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/geometry_collection.cr","line_number":24,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"visibility":"Public","body":"geometries = [] of GeoJSON::Object::Type\npull.read_begin_object\nwhile !pull.kind.end_object?\n if pull.kind.string? && (pull.read_string == \"geometries\")\n geometries = read_geometries(pull)\n else\n pull.read_next\n end\nend\nGeoJSON::GeometryCollection.new(geometries)\n"}},{"html_id":"new(geometries:Array(GeoJSON::Object::Type),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `GeometryCollection` containing the given *geometries* and\noptional bounding box *bbox*.","summary":"

Creates a new GeometryCollection containing the given geometries and optional bounding box bbox.

","abstract":false,"args":[{"name":"geometries","external_name":"geometries","restriction":"Array(GeoJSON::Object::Type)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(geometries : Array(GeoJSON::Object::Type), *, bbox = nil)","args_html":"(geometries : Array(GeoJSON::Object::Type), *, bbox = nil)","location":{"filename":"src/geojson/geometry_collection.cr","line_number":19,"url":null},"def":{"name":"new","args":[{"name":"geometries","external_name":"geometries","restriction":"Array(GeoJSON::Object::Type)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(geometries, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/geometry_collection.cr","line_number":58,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\ngeometries.each do |object|\n object.bbox.try do |object_bbox|\n if result[0] > object_bbox[0]\n result[0] = object_bbox[0]\n end\n if result[1] > object_bbox[1]\n result[1] = object_bbox[1]\n end\n if result[2] < object_bbox[2]\n result[2] = object_bbox[2]\n end\n if result[3] < object_bbox[3]\n result[3] = object_bbox[3]\n end\n end\nend\nresult\n"}},{"html_id":"geometries:Array(GeoJSON::Object::Type)-instance-method","name":"geometries","doc":"Returns an array of the geometries in this `GeometryCollection`","summary":"

Returns an array of the geometries in this GeometryCollection

","abstract":false,"location":{"filename":"src/geojson/geometry_collection.cr","line_number":15,"url":null},"def":{"name":"geometries","return_type":"Array(GeoJSON::Object::Type)","visibility":"Public","body":"@geometries"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this GeometryCollection's GeoJSON type (\"GeometryCollection\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/geometry_collection.cr","line_number":12,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/LineString","path":"GeoJSON/LineString.html","kind":"class","full_name":"GeoJSON::LineString","name":"LineString","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/line_string.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `LineString` is a `Geometry` representing two or more points in geographic\nspace connected consecutively by lines.\n\nThis class corresponds to the [GeoJSON LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4).","summary":"

A LineString is a Geometry representing two or more points in geographic space connected consecutively by lines.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `LineString` is a `Geometry` representing two or more points in geographic\nspace connected consecutively by lines.\n\nThis class corresponds to the [GeoJSON LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4).","summary":"

A LineString is a Geometry representing two or more points in geographic space connected consecutively by lines.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/line_string.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Coordinates),*,bbox=nil)-class-method","name":"new","doc":"Create a new `LineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new LineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Coordinates)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Coordinates), *, bbox = nil)","args_html":"(coordinates : Array(Coordinates), *, bbox = nil)","location":{"filename":"src/geojson/line_string.cr","line_number":18,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Coordinates)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Point),*,bbox=nil)-class-method","name":"new","doc":"Create a new `LineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new LineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Point), *, bbox = nil)","args_html":"(coordinates : Array(Point), *, bbox = nil)","location":{"filename":"src/geojson/line_string.cr","line_number":23,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Float64)),*,bbox=nil)-class-method","name":"new","doc":"Create a new `LineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new LineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Float64)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Float64)), *, bbox = nil)","location":{"filename":"src/geojson/line_string.cr","line_number":30,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the LineString vertex at the given index.","summary":"

Gets the LineString vertex at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/line_string.cr","line_number":14,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the LineString vertex at the given index.","summary":"

Gets the LineString vertex at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/line_string.cr","line_number":14,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/line_string.cr","line_number":36,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Coordinates)-instance-method","name":"coordinates","doc":"Gets this LineString's GeoJSON type (\"LineString\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/line_string.cr","line_number":11,"url":null},"def":{"name":"coordinates","return_type":"Array(Coordinates)","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this LineString's GeoJSON type (\"LineString\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/line_string.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/MultiLineString","path":"GeoJSON/MultiLineString.html","kind":"class","full_name":"GeoJSON::MultiLineString","name":"MultiLineString","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/multi_line_string.cr","line_number":5,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `MultiLineString` is a `Geometry` representing several `LineString`s.\n\nThis class corresponds to the [GeoJSON MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5).","summary":"

A MultiLineString is a Geometry representing several LineStrings.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `MultiLineString` is a `Geometry` representing several `LineString`s.\n\nThis class corresponds to the [GeoJSON MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5).","summary":"

A MultiLineString is a Geometry representing several LineStrings.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":5,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(LineString),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiLineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiLineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(LineString)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(LineString), *, bbox = nil)","args_html":"(coordinates : Array(LineString), *, bbox = nil)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":17,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(LineString)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Array(Float64))),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiLineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiLineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","args_html":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"<<(line_string:Array(LineString))-instance-method","name":"<<","doc":"Adds the given *line_string* to this MultiLineString.","summary":"

Adds the given line_string to this MultiLineString.

","abstract":false,"args":[{"name":"line_string","external_name":"line_string","restriction":"Array(LineString)"}],"args_string":"(line_string : Array(LineString))","args_html":"(line_string : Array(LineString))","location":{"filename":"src/geojson/multi_line_string.cr","line_number":29,"url":null},"def":{"name":"<<","args":[{"name":"line_string","external_name":"line_string","restriction":"Array(LineString)"}],"visibility":"Public","body":"@coordinates << line_string"}},{"html_id":"<<(coordinate:Array(Array(Float64)))-instance-method","name":"<<","doc":"Adds the given *coordinate* to this MultiLineString.","summary":"

Adds the given coordinate to this MultiLineString.

","abstract":false,"args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Float64))"}],"args_string":"(coordinate : Array(Array(Float64)))","args_html":"(coordinate : Array(Array(Float64)))","location":{"filename":"src/geojson/multi_line_string.cr","line_number":34,"url":null},"def":{"name":"<<","args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Float64))"}],"visibility":"Public","body":"@coordinates << (LineString.new(coordinate)).coordinates"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the `LineString` at the given index.","summary":"

Gets the LineString at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the `LineString` at the given index.","summary":"

Gets the LineString at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_line_string.cr","line_number":38,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |line|\n line.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Array(GeoJSON::Coordinates))-instance-method","name":"coordinates","doc":"Returns an array of this MultiLineString's coordinates.","summary":"

Returns an array of this MultiLineString's coordinates.

","abstract":false,"location":{"filename":"src/geojson/multi_line_string.cr","line_number":10,"url":null},"def":{"name":"coordinates","return_type":"Array(Array(GeoJSON::Coordinates))","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this MultiLineString's GeoJSON type (\"MultiLineString\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_line_string.cr","line_number":7,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/MultiPoint","path":"GeoJSON/MultiPoint.html","kind":"class","full_name":"GeoJSON::MultiPoint","name":"MultiPoint","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/multi_point.cr","line_number":5,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `MultiPoint` is a `Geometry` representing several `Point`s.\n\nThis class corresponds to the [GeoJSON MultiPoint](https://tools.ietf.org/html/rfc7946#section-3.1.3).","summary":"

A MultiPoint is a Geometry representing several Points.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `MultiPoint` is a `Geometry` representing several `Point`s.\n\nThis class corresponds to the [GeoJSON MultiPoint](https://tools.ietf.org/html/rfc7946#section-3.1.3).","summary":"

A MultiPoint is a Geometry representing several Points.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/multi_point.cr","line_number":5,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Point),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPoint` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPoint with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Point), *, bbox = nil)","args_html":"(coordinates : Array(Point), *, bbox = nil)","location":{"filename":"src/geojson/multi_point.cr","line_number":17,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Float64)),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPoint` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPoint with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Float64)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Float64)), *, bbox = nil)","location":{"filename":"src/geojson/multi_point.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"<<(point:Array(Point))-instance-method","name":"<<","doc":"Adds the given *point* to this MultiPoint.","summary":"

Adds the given point to this MultiPoint.

","abstract":false,"args":[{"name":"point","external_name":"point","restriction":"Array(Point)"}],"args_string":"(point : Array(Point))","args_html":"(point : Array(Point))","location":{"filename":"src/geojson/multi_point.cr","line_number":29,"url":null},"def":{"name":"<<","args":[{"name":"point","external_name":"point","restriction":"Array(Point)"}],"visibility":"Public","body":"@coordinates << point.coordinates"}},{"html_id":"<<(coordinate:Array(Float64))-instance-method","name":"<<","doc":"Adds the given *coordinate* to this MultiPoint.","summary":"

Adds the given coordinate to this MultiPoint.

","abstract":false,"args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Float64)"}],"args_string":"(coordinate : Array(Float64))","args_html":"(coordinate : Array(Float64))","location":{"filename":"src/geojson/multi_point.cr","line_number":34,"url":null},"def":{"name":"<<","args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Float64)"}],"visibility":"Public","body":"@coordinates << (Point.new(coordinate)).coordinates"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the `Point` at the given index.","summary":"

Gets the Point at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/multi_point.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the `Point` at the given index.","summary":"

Gets the Point at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/multi_point.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_point.cr","line_number":38,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Coordinates)-instance-method","name":"coordinates","doc":"Returns an array of this MultiPoint's coordinates.","summary":"

Returns an array of this MultiPoint's coordinates.

","abstract":false,"location":{"filename":"src/geojson/multi_point.cr","line_number":10,"url":null},"def":{"name":"coordinates","return_type":"Array(Coordinates)","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this MultiPoint's GeoJSON type (\"MultiPoint\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_point.cr","line_number":7,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/MultiPolygon","path":"GeoJSON/MultiPolygon.html","kind":"class","full_name":"GeoJSON::MultiPolygon","name":"MultiPolygon","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/multi_polygon.cr","line_number":5,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `MultiPolygon` is a `Geometry` representing several `Polygon`s.\n\nThis class corresponds to the [GeoJSON MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7).","summary":"

A MultiPolygon is a Geometry representing several Polygons.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `MultiPolygon` is a `Geometry` representing several `Polygon`s.\n\nThis class corresponds to the [GeoJSON MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7).","summary":"

A MultiPolygon is a Geometry representing several Polygons.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":5,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Polygon),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPolygon` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPolygon with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Polygon)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Polygon), *, bbox = nil)","args_html":"(coordinates : Array(Polygon), *, bbox = nil)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":17,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Polygon)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Array(Array(Float64)))),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPolygon` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPolygon with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Array(Float64))))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Array(Array(Float64)))), *, bbox = nil)","args_html":"(coordinates : Array(Array(Array(Array(Float64)))), *, bbox = nil)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Array(Float64))))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"<<(polygon:Array(Polygon))-instance-method","name":"<<","doc":"Adds the given *polygon* to this MultiPolygon.","summary":"

Adds the given polygon to this MultiPolygon.

","abstract":false,"args":[{"name":"polygon","external_name":"polygon","restriction":"Array(Polygon)"}],"args_string":"(polygon : Array(Polygon))","args_html":"(polygon : Array(Polygon))","location":{"filename":"src/geojson/multi_polygon.cr","line_number":29,"url":null},"def":{"name":"<<","args":[{"name":"polygon","external_name":"polygon","restriction":"Array(Polygon)"}],"visibility":"Public","body":"@coordinates << polygon.coordinates"}},{"html_id":"<<(coordinate:Array(Array(Array(Float64))))-instance-method","name":"<<","doc":"Adds the given *coordinate* to this MultiPolygon.","summary":"

Adds the given coordinate to this MultiPolygon.

","abstract":false,"args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Array(Float64)))"}],"args_string":"(coordinate : Array(Array(Array(Float64))))","args_html":"(coordinate : Array(Array(Array(Float64))))","location":{"filename":"src/geojson/multi_polygon.cr","line_number":34,"url":null},"def":{"name":"<<","args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Array(Float64)))"}],"visibility":"Public","body":"@coordinates << (Polygon.new(coordinate)).coordinates"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the `Polygon` at the given index.","summary":"

Gets the Polygon at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the `Polygon` at the given index.","summary":"

Gets the Polygon at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_polygon.cr","line_number":38,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |polygon|\n polygon.each do |ring|\n ring.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\n end\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Array(Array(GeoJSON::Coordinates)))-instance-method","name":"coordinates","doc":"Returns an array of this MultiPolygon's coordinates.","summary":"

Returns an array of this MultiPolygon's coordinates.

","abstract":false,"location":{"filename":"src/geojson/multi_polygon.cr","line_number":10,"url":null},"def":{"name":"coordinates","return_type":"Array(Array(Array(GeoJSON::Coordinates)))","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this MultiPolygon's GeoJSON type (\"MultiPolygon\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_polygon.cr","line_number":7,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/Object","path":"GeoJSON/Object.html","kind":"class","full_name":"GeoJSON::Object","name":"Object","abstract":true,"superclass":{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/object.cr","line_number":14,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"}],"subclasses":[{"html_id":"geojson/GeoJSON/Feature","kind":"class","full_name":"GeoJSON::Feature","name":"Feature"},{"html_id":"geojson/GeoJSON/FeatureCollection","kind":"class","full_name":"GeoJSON::FeatureCollection","name":"FeatureCollection"},{"html_id":"geojson/GeoJSON/GeometryCollection","kind":"class","full_name":"GeoJSON::GeometryCollection","name":"GeometryCollection"},{"html_id":"geojson/GeoJSON/LineString","kind":"class","full_name":"GeoJSON::LineString","name":"LineString"},{"html_id":"geojson/GeoJSON/MultiLineString","kind":"class","full_name":"GeoJSON::MultiLineString","name":"MultiLineString"},{"html_id":"geojson/GeoJSON/MultiPoint","kind":"class","full_name":"GeoJSON::MultiPoint","name":"MultiPoint"},{"html_id":"geojson/GeoJSON/MultiPolygon","kind":"class","full_name":"GeoJSON::MultiPolygon","name":"MultiPolygon"},{"html_id":"geojson/GeoJSON/Point","kind":"class","full_name":"GeoJSON::Point","name":"Point"},{"html_id":"geojson/GeoJSON/Polygon","kind":"class","full_name":"GeoJSON::Polygon","name":"Polygon"}],"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"GeoJSON Object\n\nA GeoJSON object represents a Geometry, Feature, or collection of Features.\n\n* A GeoJSON object is a JSON object.\n* A GeoJSON object has a member with the name \"type\". The value of\n the member MUST be one of the GeoJSON types.\n `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`,\n `GeometryCollection`, `Feature`, and `FeatureCollection`\n* A GeoJSON object MAY have a \"bbox\" member, the value of which MUST\n be a bounding box array\n* A GeoJSON object MAY have other members","summary":"

GeoJSON Object

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/object.cr","line_number":28,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"location = pull.location\ndiscriminator_value = nil\njson = String.build do |io|\n JSON.build(io) do |builder|\n builder.start_object\n pull.read_object do |key|\n if key == \"type\"\n value_kind = pull.kind\n case value_kind\n when .string?\n discriminator_value = pull.string_value\n when .int?\n discriminator_value = pull.int_value\n when .bool?\n discriminator_value = pull.bool_value\n else\n raise(::JSON::SerializableError.new(\"JSON discriminator field 'type' has an invalid value type of #{value_kind.to_s}\", to_s, nil, *location, nil))\n end\n builder.field(key, discriminator_value)\n pull.read_next\n else\n builder.field(key) do\n pull.read_raw(builder)\n end\n end\n end\n builder.end_object\n end\nend\nif discriminator_value\nelse\n raise(::JSON::SerializableError.new(\"Missing JSON discriminator field 'type'\", to_s, nil, *location, nil))\nend\ncase discriminator_value\nwhen \"Point\"\n Point.from_json(json)\nwhen \"MultiPoint\"\n MultiPoint.from_json(json)\nwhen \"LineString\"\n LineString.from_json(json)\nwhen \"MultiLineString\"\n MultiLineString.from_json(json)\nwhen \"Polygon\"\n Polygon.from_json(json)\nwhen \"MultiPolygon\"\n MultiPolygon.from_json(json)\nelse\n raise(::JSON::SerializableError.new(\"Unknown 'type' discriminator value: #{discriminator_value.inspect}\", to_s, nil, *location, nil))\nend\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":true,"location":{"filename":"src/geojson/object.cr","line_number":26,"url":null},"def":{"name":"bbox","visibility":"Public","body":""}},{"html_id":"type:String-instance-method","name":"type","abstract":true,"location":{"filename":"src/geojson/object.cr","line_number":23,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":""}}],"types":[{"html_id":"geojson/GeoJSON/Object/Type","path":"GeoJSON/Object/Type.html","kind":"alias","full_name":"GeoJSON::Object::Type","name":"Type","abstract":false,"locations":[{"filename":"src/geojson/object.cr","line_number":21,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":true,"aliased":"GeoJSON::Object+","aliased_html":"GeoJSON::Object","const":false,"namespace":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"doc":"All possible GeoJSON types.","summary":"

All possible GeoJSON types.

"}]},{"html_id":"geojson/GeoJSON/Point","path":"GeoJSON/Point.html","kind":"class","full_name":"GeoJSON::Point","name":"Point","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/point.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Point` is a `Geometry` representing a single `Position` in geographic\nspace.\n\nThis class corresponds to the [GeoJSON Point](https://tools.ietf.org/html/rfc7946#section-3.1.2).","summary":"

A Point is a Geometry representing a single Position in geographic space.

","constructors":[{"html_id":"new(longitude,latitude,altitude=nil,bbox=nil)-class-method","name":"new","doc":"Creates a new `Point` at the given *longitude*, *latitude*, and optional\n*altitude*, and with optional bounding box *bbox*.","summary":"

Creates a new Point at the given longitude, latitude, and optional altitude, and with optional bounding box bbox.

","abstract":false,"args":[{"name":"longitude","external_name":"longitude","restriction":""},{"name":"latitude","external_name":"latitude","restriction":""},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(longitude, latitude, altitude = nil, bbox = nil)","args_html":"(longitude, latitude, altitude = nil, bbox = nil)","location":{"filename":"src/geojson/point.cr","line_number":15,"url":null},"def":{"name":"new","args":[{"name":"longitude","external_name":"longitude","restriction":""},{"name":"latitude","external_name":"latitude","restriction":""},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(longitude, latitude, altitude, bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `Point` is a `Geometry` representing a single `Position` in geographic\nspace.\n\nThis class corresponds to the [GeoJSON Point](https://tools.ietf.org/html/rfc7946#section-3.1.2).","summary":"

A Point is a Geometry representing a single Position in geographic space.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/point.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:GeoJSON::Coordinates,*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Point` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"GeoJSON::Coordinates"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : GeoJSON::Coordinates, *, bbox = nil)","args_html":"(coordinates : GeoJSON::Coordinates, *, bbox = nil)","location":{"filename":"src/geojson/point.cr","line_number":21,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"GeoJSON::Coordinates"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Float64),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Point` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Float64), *, bbox = nil)","args_html":"(coordinates : Array(Float64), *, bbox = nil)","location":{"filename":"src/geojson/point.cr","line_number":25,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

Returns true if this reference is the same as other.

","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif coordinates == other.coordinates\nelse\n return false\nend\ntrue\n"}},{"html_id":"altitude(*args,**options)-instance-method","name":"altitude","doc":"Gets this Point's altitude.\n\nTechnically, this positional value is meant to be the height in meters\nabove the WGS84 ellipsoid.","summary":"

Gets this Point's altitude.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/point.cr","line_number":43,"url":null},"def":{"name":"altitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.altitude(*args, **options)"}},{"html_id":"altitude(*args,**options,&)-instance-method","name":"altitude","doc":"Gets this Point's altitude.\n\nTechnically, this positional value is meant to be the height in meters\nabove the WGS84 ellipsoid.","summary":"

Gets this Point's altitude.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/point.cr","line_number":43,"url":null},"def":{"name":"altitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.altitude(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/point.cr","line_number":29,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\n[coordinates[0], coordinates[1], coordinates[0], coordinates[1]]\n"}},{"html_id":"coordinates:Coordinates-instance-method","name":"coordinates","doc":"Returns this Point's coordinates.","summary":"

Returns this Point's coordinates.

","abstract":false,"location":{"filename":"src/geojson/point.cr","line_number":11,"url":null},"def":{"name":"coordinates","return_type":"Coordinates","visibility":"Public","body":"@coordinates"}},{"html_id":"hash(hasher)-instance-method","name":"hash","doc":"See `Object#hash(hasher)`","summary":"

See Object#hash(hasher)

","abstract":false,"args":[{"name":"hasher","external_name":"hasher","restriction":""}],"args_string":"(hasher)","args_html":"(hasher)","def":{"name":"hash","args":[{"name":"hasher","external_name":"hasher","restriction":""}],"visibility":"Public","body":"hasher = coordinates.hash(hasher)\nhasher\n"}},{"html_id":"latitude(*args,**options)-instance-method","name":"latitude","doc":"Gets this Point's latitude in decimal degrees according to WGS84.","summary":"

Gets this Point's latitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/point.cr","line_number":38,"url":null},"def":{"name":"latitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.latitude(*args, **options)"}},{"html_id":"latitude(*args,**options,&)-instance-method","name":"latitude","doc":"Gets this Point's latitude in decimal degrees according to WGS84.","summary":"

Gets this Point's latitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/point.cr","line_number":38,"url":null},"def":{"name":"latitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.latitude(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"longitude(*args,**options)-instance-method","name":"longitude","doc":"Gets this Point's longitude in decimal degrees according to WGS84.","summary":"

Gets this Point's longitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/point.cr","line_number":36,"url":null},"def":{"name":"longitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.longitude(*args, **options)"}},{"html_id":"longitude(*args,**options,&)-instance-method","name":"longitude","doc":"Gets this Point's longitude in decimal degrees according to WGS84.","summary":"

Gets this Point's longitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/point.cr","line_number":36,"url":null},"def":{"name":"longitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.longitude(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this Point's GeoJSON type (\"Point\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/point.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/Polygon","path":"GeoJSON/Polygon.html","kind":"class","full_name":"GeoJSON::Polygon","name":"Polygon","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/polygon.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Polygon` is a `Geometry` representing a closed geometric figure in\ngeographic space with optional holes within it.\n\nThis class corresponds to the [GeoJSON Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6).","summary":"

A Polygon is a Geometry representing a closed geometric figure in geographic space with optional holes within it.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `Polygon` is a `Geometry` representing a closed geometric figure in\ngeographic space with optional holes within it.\n\nThis class corresponds to the [GeoJSON Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6).","summary":"

A Polygon is a Geometry representing a closed geometric figure in geographic space with optional holes within it.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/polygon.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Array(Coordinates)),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Polygon` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Coordinates))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Coordinates)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Coordinates)), *, bbox = nil)","location":{"filename":"src/geojson/polygon.cr","line_number":15,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Coordinates))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Point)),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Polygon` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Point))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Point)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Point)), *, bbox = nil)","location":{"filename":"src/geojson/polygon.cr","line_number":20,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Point))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Array(Float64))),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Polygon` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","args_html":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","location":{"filename":"src/geojson/polygon.cr","line_number":29,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/polygon.cr","line_number":37,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |ring|\n ring.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Array(Coordinates))-instance-method","name":"coordinates","doc":"Returns this Polygon's linear ring coordinates.","summary":"

Returns this Polygon's linear ring coordinates.

","abstract":false,"location":{"filename":"src/geojson/polygon.cr","line_number":11,"url":null},"def":{"name":"coordinates","return_type":"Array(Array(Coordinates))","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this Polygon's GeoJSON type (\"Polygon\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/polygon.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]}]}]}} \ No newline at end of file diff --git a/js/doc.js b/js/doc.js new file mode 100644 index 0000000..45d38b9 --- /dev/null +++ b/js/doc.js @@ -0,0 +1,1099 @@ +window.CrystalDocs = (window.CrystalDocs || {}); + +CrystalDocs.base_path = (CrystalDocs.base_path || ""); + +CrystalDocs.searchIndex = (CrystalDocs.searchIndex || false); +CrystalDocs.MAX_RESULTS_DISPLAY = 140; + +CrystalDocs.runQuery = function(query) { + function searchType(type, query, results) { + var matches = []; + var matchedFields = []; + var name = type.full_name; + var i = name.lastIndexOf("::"); + if (i > 0) { + name = name.substring(i + 2); + } + var nameMatches = query.matches(name); + if (nameMatches){ + matches = matches.concat(nameMatches); + matchedFields.push("name"); + } + + var namespaceMatches = query.matchesNamespace(type.full_name); + if(namespaceMatches){ + matches = matches.concat(namespaceMatches); + matchedFields.push("name"); + } + + var docMatches = query.matches(type.doc); + if(docMatches){ + matches = matches.concat(docMatches); + matchedFields.push("doc"); + } + if (matches.length > 0) { + results.push({ + id: type.html_id, + result_type: "type", + kind: type.kind, + name: name, + full_name: type.full_name, + href: type.path, + summary: type.summary, + matched_fields: matchedFields, + matched_terms: matches + }); + } + + if (type.instance_methods) { + type.instance_methods.forEach(function(method) { + searchMethod(method, type, "instance_method", query, results); + }) + } + if (type.class_methods) { + type.class_methods.forEach(function(method) { + searchMethod(method, type, "class_method", query, results); + }) + } + if (type.constructors) { + type.constructors.forEach(function(constructor) { + searchMethod(constructor, type, "constructor", query, results); + }) + } + if (type.macros) { + type.macros.forEach(function(macro) { + searchMethod(macro, type, "macro", query, results); + }) + } + if (type.constants) { + type.constants.forEach(function(constant){ + searchConstant(constant, type, query, results); + }); + } + if (type.types) { + type.types.forEach(function(subtype){ + searchType(subtype, query, results); + }); + } + }; + + function searchMethod(method, type, kind, query, results) { + var matches = []; + var matchedFields = []; + var nameMatches = query.matchesMethod(method.name, kind, type); + if (nameMatches){ + matches = matches.concat(nameMatches); + matchedFields.push("name"); + } + + if (method.args) { + method.args.forEach(function(arg){ + var argMatches = query.matches(arg.external_name); + if (argMatches) { + matches = matches.concat(argMatches); + matchedFields.push("args"); + } + }); + } + + var docMatches = query.matches(type.doc); + if(docMatches){ + matches = matches.concat(docMatches); + matchedFields.push("doc"); + } + + if (matches.length > 0) { + var typeMatches = query.matches(type.full_name); + if (typeMatches) { + matchedFields.push("type"); + matches = matches.concat(typeMatches); + } + results.push({ + id: method.html_id, + type: type.full_name, + result_type: kind, + name: method.name, + full_name: type.full_name + "#" + method.name, + args_string: method.args_string, + summary: method.summary, + href: type.path + "#" + method.html_id, + matched_fields: matchedFields, + matched_terms: matches + }); + } + } + + function searchConstant(constant, type, query, results) { + var matches = []; + var matchedFields = []; + var nameMatches = query.matches(constant.name); + if (nameMatches){ + matches = matches.concat(nameMatches); + matchedFields.push("name"); + } + var docMatches = query.matches(constant.doc); + if(docMatches){ + matches = matches.concat(docMatches); + matchedFields.push("doc"); + } + if (matches.length > 0) { + var typeMatches = query.matches(type.full_name); + if (typeMatches) { + matchedFields.push("type"); + matches = matches.concat(typeMatches); + } + results.push({ + id: constant.id, + type: type.full_name, + result_type: "constant", + name: constant.name, + full_name: type.full_name + "#" + constant.name, + value: constant.value, + summary: constant.summary, + href: type.path + "#" + constant.id, + matched_fields: matchedFields, + matched_terms: matches + }); + } + } + + var results = []; + searchType(CrystalDocs.searchIndex.program, query, results); + return results; +}; + +CrystalDocs.rankResults = function(results, query) { + function uniqueArray(ar) { + var j = {}; + + ar.forEach(function(v) { + j[v + "::" + typeof v] = v; + }); + + return Object.keys(j).map(function(v) { + return j[v]; + }); + } + + results = results.sort(function(a, b) { + var matchedTermsDiff = uniqueArray(b.matched_terms).length - uniqueArray(a.matched_terms).length; + var aHasDocs = b.matched_fields.includes("doc"); + var bHasDocs = b.matched_fields.includes("doc"); + + var aOnlyDocs = aHasDocs && a.matched_fields.length == 1; + var bOnlyDocs = bHasDocs && b.matched_fields.length == 1; + + if (a.result_type == "type" && b.result_type != "type" && !aOnlyDocs) { + if(CrystalDocs.DEBUG) { console.log("a is type b not"); } + return -1; + } else if (b.result_type == "type" && a.result_type != "type" && !bOnlyDocs) { + if(CrystalDocs.DEBUG) { console.log("b is type, a not"); } + return 1; + } + if (a.matched_fields.includes("name")) { + if (b.matched_fields.includes("name")) { + var a_name = (CrystalDocs.prefixForType(a.result_type) || "") + ((a.result_type == "type") ? a.full_name : a.name); + var b_name = (CrystalDocs.prefixForType(b.result_type) || "") + ((b.result_type == "type") ? b.full_name : b.name); + a_name = a_name.toLowerCase(); + b_name = b_name.toLowerCase(); + for(var i = 0; i < query.normalizedTerms.length; i++) { + var term = query.terms[i].replace(/^::?|::?$/, ""); + var a_orig_index = a_name.indexOf(term); + var b_orig_index = b_name.indexOf(term); + if(CrystalDocs.DEBUG) { console.log("term: " + term + " a: " + a_name + " b: " + b_name); } + if(CrystalDocs.DEBUG) { console.log(a_orig_index, b_orig_index, a_orig_index - b_orig_index); } + if (a_orig_index >= 0) { + if (b_orig_index >= 0) { + if(CrystalDocs.DEBUG) { console.log("both have exact match", a_orig_index > b_orig_index ? -1 : 1); } + if(a_orig_index != b_orig_index) { + if(CrystalDocs.DEBUG) { console.log("both have exact match at different positions", a_orig_index > b_orig_index ? 1 : -1); } + return a_orig_index > b_orig_index ? 1 : -1; + } + } else { + if(CrystalDocs.DEBUG) { console.log("a has exact match, b not"); } + return -1; + } + } else if (b_orig_index >= 0) { + if(CrystalDocs.DEBUG) { console.log("b has exact match, a not"); } + return 1; + } + } + } else { + if(CrystalDocs.DEBUG) { console.log("a has match in name, b not"); } + return -1; + } + } else if ( + !a.matched_fields.includes("name") && + b.matched_fields.includes("name") + ) { + return 1; + } + + if (matchedTermsDiff != 0 || (aHasDocs != bHasDocs)) { + if(CrystalDocs.DEBUG) { console.log("matchedTermsDiff: " + matchedTermsDiff, aHasDocs, bHasDocs); } + return matchedTermsDiff; + } + + var matchedFieldsDiff = b.matched_fields.length - a.matched_fields.length; + if (matchedFieldsDiff != 0) { + if(CrystalDocs.DEBUG) { console.log("matched to different number of fields: " + matchedFieldsDiff); } + return matchedFieldsDiff > 0 ? 1 : -1; + } + + var nameCompare = a.name.localeCompare(b.name); + if(nameCompare != 0){ + if(CrystalDocs.DEBUG) { console.log("nameCompare resulted in: " + a.name + "<=>" + b.name + ": " + nameCompare); } + return nameCompare > 0 ? 1 : -1; + } + + if(a.matched_fields.includes("args") && b.matched_fields.includes("args")) { + for(var i = 0; i < query.terms.length; i++) { + var term = query.terms[i]; + var aIndex = a.args_string.indexOf(term); + var bIndex = b.args_string.indexOf(term); + if(CrystalDocs.DEBUG) { console.log("index of " + term + " in args_string: " + aIndex + " - " + bIndex); } + if(aIndex >= 0){ + if(bIndex >= 0){ + if(aIndex != bIndex){ + return aIndex > bIndex ? 1 : -1; + } + }else{ + return -1; + } + }else if(bIndex >= 0) { + return 1; + } + } + } + + return 0; + }); + + if (results.length > 1) { + // if we have more than two search terms, only include results with the most matches + var bestMatchedTerms = uniqueArray(results[0].matched_terms).length; + + results = results.filter(function(result) { + return uniqueArray(result.matched_terms).length + 1 >= bestMatchedTerms; + }); + } + return results; +}; + +CrystalDocs.prefixForType = function(type) { + switch (type) { + case "instance_method": + return "#"; + + case "class_method": + case "macro": + case "constructor": + return "."; + + default: + return false; + } +}; + +CrystalDocs.displaySearchResults = function(results, query) { + function sanitize(html){ + return html.replace(/<(?!\/?code)[^>]+>/g, ""); + } + + // limit results + if (results.length > CrystalDocs.MAX_RESULTS_DISPLAY) { + results = results.slice(0, CrystalDocs.MAX_RESULTS_DISPLAY); + } + + var $frag = document.createDocumentFragment(); + var $resultsElem = document.querySelector(".search-list"); + $resultsElem.innerHTML = ""; + + results.forEach(function(result, i) { + var url = CrystalDocs.base_path + result.href; + var type = false; + + var title = query.highlight(result.result_type == "type" ? result.full_name : result.name); + + var prefix = CrystalDocs.prefixForType(result.result_type); + if (prefix) { + title = "" + prefix + "" + title; + } + + title = "" + title + ""; + + if (result.args_string) { + title += + "" + query.highlight(result.args_string) + ""; + } + + $elem = document.createElement("li"); + $elem.className = "search-result search-result--" + result.result_type; + $elem.dataset.href = url; + $elem.setAttribute("title", result.full_name + " docs page"); + + var $title = document.createElement("div"); + $title.setAttribute("class", "search-result__title"); + var $titleLink = document.createElement("a"); + $titleLink.setAttribute("href", url); + + $titleLink.innerHTML = title; + $title.appendChild($titleLink); + $elem.appendChild($title); + $elem.addEventListener("click", function() { + $titleLink.click(); + }); + + if (result.result_type !== "type") { + var $type = document.createElement("div"); + $type.setAttribute("class", "search-result__type"); + $type.innerHTML = query.highlight(result.type); + $elem.appendChild($type); + } + + if(result.summary){ + var $doc = document.createElement("div"); + $doc.setAttribute("class", "search-result__doc"); + $doc.innerHTML = query.highlight(sanitize(result.summary)); + $elem.appendChild($doc); + } + + $elem.appendChild(document.createComment(JSON.stringify(result))); + $frag.appendChild($elem); + }); + + $resultsElem.appendChild($frag); + + CrystalDocs.toggleResultsList(true); +}; + +CrystalDocs.toggleResultsList = function(visible) { + if (visible) { + document.querySelector(".types-list").classList.add("hidden"); + document.querySelector(".search-results").classList.remove("hidden"); + } else { + document.querySelector(".types-list").classList.remove("hidden"); + document.querySelector(".search-results").classList.add("hidden"); + } +}; + +CrystalDocs.Query = function(string) { + this.original = string; + this.terms = string.split(/\s+/).filter(function(word) { + return CrystalDocs.Query.stripModifiers(word).length > 0; + }); + + var normalized = this.terms.map(CrystalDocs.Query.normalizeTerm); + this.normalizedTerms = normalized; + + function runMatcher(field, matcher) { + if (!field) { + return false; + } + var normalizedValue = CrystalDocs.Query.normalizeTerm(field); + + var matches = []; + normalized.forEach(function(term) { + if (matcher(normalizedValue, term)) { + matches.push(term); + } + }); + return matches.length > 0 ? matches : false; + } + + this.matches = function(field) { + return runMatcher(field, function(normalized, term) { + if (term[0] == "#" || term[0] == ".") { + return false; + } + return normalized.indexOf(term) >= 0; + }); + }; + + function namespaceMatcher(normalized, term){ + var i = term.indexOf(":"); + if(i >= 0){ + term = term.replace(/^::?|::?$/, ""); + var index = normalized.indexOf(term); + if((index == 0) || (index > 0 && normalized[index-1] == ":")){ + return true; + } + } + return false; + } + this.matchesMethod = function(name, kind, type) { + return runMatcher(name, function(normalized, term) { + var i = term.indexOf("#"); + if(i >= 0){ + if (kind != "instance_method") { + return false; + } + }else{ + i = term.indexOf("."); + if(i >= 0){ + if (kind != "class_method" && kind != "macro" && kind != "constructor") { + return false; + } + }else{ + //neither # nor . + if(term.indexOf(":") && namespaceMatcher(normalized, term)){ + return true; + } + } + } + + var methodName = term; + if(i >= 0){ + var termType = term.substring(0, i); + methodName = term.substring(i+1); + + if(termType != "") { + if(CrystalDocs.Query.normalizeTerm(type.full_name).indexOf(termType) < 0){ + return false; + } + } + } + return normalized.indexOf(methodName) >= 0; + }); + }; + + this.matchesNamespace = function(namespace){ + return runMatcher(namespace, namespaceMatcher); + }; + + this.highlight = function(string) { + if (typeof string == "undefined") { + return ""; + } + function escapeRegExp(s) { + return s.replace(/[.*+?\^${}()|\[\]\\]/g, "\\$&").replace(/^[#\.:]+/, ""); + } + return string.replace( + new RegExp("(" + this.normalizedTerms.map(escapeRegExp).join("|") + ")", "gi"), + "$1" + ); + }; +}; +CrystalDocs.Query.normalizeTerm = function(term) { + return term.toLowerCase(); +}; +CrystalDocs.Query.stripModifiers = function(term) { + switch (term[0]) { + case "#": + case ".": + case ":": + return term.substr(1); + + default: + return term; + } +} + +CrystalDocs.search = function(string) { + if(!CrystalDocs.searchIndex) { + console.log("CrystalDocs search index not initialized, delaying search"); + + document.addEventListener("CrystalDocs:loaded", function listener(){ + document.removeEventListener("CrystalDocs:loaded", listener); + CrystalDocs.search(string); + }); + return; + } + + document.dispatchEvent(new Event("CrystalDocs:searchStarted")); + + var query = new CrystalDocs.Query(string); + var results = CrystalDocs.runQuery(query); + results = CrystalDocs.rankResults(results, query); + CrystalDocs.displaySearchResults(results, query); + + document.dispatchEvent(new Event("CrystalDocs:searchPerformed")); +}; + +CrystalDocs.initializeIndex = function(data) { + CrystalDocs.searchIndex = data; + + document.dispatchEvent(new Event("CrystalDocs:loaded")); +}; + +CrystalDocs.loadIndex = function() { + function loadJSON(file, callback) { + var xobj = new XMLHttpRequest(); + xobj.overrideMimeType("application/json"); + xobj.open("GET", file, true); + xobj.onreadystatechange = function() { + if (xobj.readyState == 4 && xobj.status == "200") { + callback(xobj.responseText); + } + }; + xobj.send(null); + } + + function loadScript(file) { + script = document.createElement("script"); + script.src = file; + document.body.appendChild(script); + } + + function parseJSON(json) { + CrystalDocs.initializeIndex(JSON.parse(json)); + } + + for(var i = 0; i < document.scripts.length; i++){ + var script = document.scripts[i]; + if (script.src && script.src.indexOf("js/doc.js") >= 0) { + if (script.src.indexOf("file://") == 0) { + // We need to support JSONP files for the search to work on local file system. + var jsonPath = script.src.replace("js/doc.js", "search-index.js"); + loadScript(jsonPath); + return; + } else { + var jsonPath = script.src.replace("js/doc.js", "index.json"); + loadJSON(jsonPath, parseJSON); + return; + } + } + } + console.error("Could not find location of js/doc.js"); +}; + +// Callback for jsonp +function crystal_doc_search_index_callback(data) { + CrystalDocs.initializeIndex(data); +} + +Navigator = function(sidebar, searchInput, list, leaveSearchScope){ + this.list = list; + var self = this; + + var performingSearch = false; + + document.addEventListener('CrystalDocs:searchStarted', function(){ + performingSearch = true; + }); + document.addEventListener('CrystalDocs:searchDebounceStarted', function(){ + performingSearch = true; + }); + document.addEventListener('CrystalDocs:searchPerformed', function(){ + performingSearch = false; + }); + document.addEventListener('CrystalDocs:searchDebounceStopped', function(event){ + performingSearch = false; + }); + + function delayWhileSearching(callback) { + if(performingSearch){ + document.addEventListener('CrystalDocs:searchPerformed', function listener(){ + document.removeEventListener('CrystalDocs:searchPerformed', listener); + + // add some delay to let search results display kick in + setTimeout(callback, 100); + }); + }else{ + callback(); + } + } + + function clearMoveTimeout() { + clearTimeout(self.moveTimeout); + self.moveTimeout = null; + } + + function startMoveTimeout(upwards){ + /*if(self.moveTimeout) { + clearMoveTimeout(); + } + + var go = function() { + if (!self.moveTimeout) return; + self.move(upwards); + self.moveTimeout = setTimeout(go, 600); + }; + self.moveTimeout = setTimeout(go, 800);*/ + } + + function scrollCenter(element) { + var rect = element.getBoundingClientRect(); + var middle = sidebar.clientHeight / 2; + sidebar.scrollTop += rect.top + rect.height / 2 - middle; + } + + var move = this.move = function(upwards){ + if(!this.current){ + this.highlightFirst(); + return true; + } + var next = upwards ? this.current.previousElementSibling : this.current.nextElementSibling; + if(next && next.classList) { + this.highlight(next); + scrollCenter(next); + return true; + } + return false; + }; + + this.moveRight = function(){ + }; + this.moveLeft = function(){ + }; + + this.highlight = function(elem) { + if(!elem){ + return; + } + this.removeHighlight(); + + this.current = elem; + this.current.classList.add("current"); + }; + + this.highlightFirst = function(){ + this.highlight(this.list.querySelector('li:first-child')); + }; + + this.removeHighlight = function() { + if(this.current){ + this.current.classList.remove("current"); + } + this.current = null; + } + + this.openSelectedResult = function() { + if(this.current) { + this.current.click(); + } + } + + this.focus = function() { + searchInput.focus(); + searchInput.select(); + this.highlightFirst(); + } + + function handleKeyUp(event) { + switch(event.key) { + case "ArrowUp": + case "ArrowDown": + case "i": + case "j": + case "k": + case "l": + case "c": + case "h": + case "t": + case "n": + event.stopPropagation(); + clearMoveTimeout(); + } + } + + function handleKeyDown(event) { + switch(event.key) { + case "Enter": + event.stopPropagation(); + event.preventDefault(); + leaveSearchScope(); + self.openSelectedResult(); + break; + case "Escape": + event.stopPropagation(); + event.preventDefault(); + leaveSearchScope(); + break; + case "j": + case "c": + case "ArrowUp": + if(event.ctrlKey || event.key == "ArrowUp") { + event.stopPropagation(); + self.move(true); + startMoveTimeout(true); + } + break; + case "k": + case "h": + case "ArrowDown": + if(event.ctrlKey || event.key == "ArrowDown") { + event.stopPropagation(); + self.move(false); + startMoveTimeout(false); + } + break; + case "k": + case "t": + case "ArrowLeft": + if(event.ctrlKey || event.key == "ArrowLeft") { + event.stopPropagation(); + self.moveLeft(); + } + break; + case "l": + case "n": + case "ArrowRight": + if(event.ctrlKey || event.key == "ArrowRight") { + event.stopPropagation(); + self.moveRight(); + } + break; + } + } + + function handleInputKeyUp(event) { + switch(event.key) { + case "ArrowUp": + case "ArrowDown": + event.stopPropagation(); + event.preventDefault(); + clearMoveTimeout(); + } + } + + function handleInputKeyDown(event) { + switch(event.key) { + case "Enter": + event.stopPropagation(); + event.preventDefault(); + delayWhileSearching(function(){ + self.openSelectedResult(); + leaveSearchScope(); + }); + break; + case "Escape": + event.stopPropagation(); + event.preventDefault(); + // remove focus from search input + leaveSearchScope(); + sidebar.focus(); + break; + case "ArrowUp": + event.stopPropagation(); + event.preventDefault(); + self.move(true); + startMoveTimeout(true); + break; + + case "ArrowDown": + event.stopPropagation(); + event.preventDefault(); + self.move(false); + startMoveTimeout(false); + break; + } + } + + sidebar.tabIndex = 100; // set tabIndex to enable keylistener + sidebar.addEventListener('keyup', function(event) { + handleKeyUp(event); + }); + sidebar.addEventListener('keydown', function(event) { + handleKeyDown(event); + }); + searchInput.addEventListener('keydown', function(event) { + handleInputKeyDown(event); + }); + searchInput.addEventListener('keyup', function(event) { + handleInputKeyUp(event); + }); + this.move(); +}; + +CrystalDocs.initializeVersions = function () { + function loadJSON(file, callback) { + var xobj = new XMLHttpRequest(); + xobj.overrideMimeType("application/json"); + xobj.open("GET", file, true); + xobj.onreadystatechange = function() { + if (xobj.readyState == 4 && xobj.status == "200") { + callback(xobj.responseText); + } + }; + xobj.send(null); + } + + function parseJSON(json) { + CrystalDocs.loadConfig(JSON.parse(json)); + } + + $elem = document.querySelector("html > head > meta[name=\"crystal_docs.json_config_url\"]") + if ($elem == undefined) { + return + } + jsonURL = $elem.getAttribute("content") + if (jsonURL && jsonURL != "") { + loadJSON(jsonURL, parseJSON); + } +} + +CrystalDocs.loadConfig = function (config) { + var projectVersions = config["versions"] + var currentVersion = document.querySelector("html > head > meta[name=\"crystal_docs.project_version\"]").getAttribute("content") + + var currentVersionInList = projectVersions.find(function (element) { + return element.name == currentVersion + }) + + if (!currentVersionInList) { + projectVersions.unshift({ name: currentVersion, url: '#' }) + } + + $version = document.querySelector(".project-summary > .project-version") + $version.innerHTML = "" + + $select = document.createElement("select") + $select.classList.add("project-versions-nav") + $select.addEventListener("change", function () { + window.location.href = this.value + }) + projectVersions.forEach(function (version) { + $item = document.createElement("option") + $item.setAttribute("value", version.url) + $item.append(document.createTextNode(version.name)) + + if (version.name == currentVersion) { + $item.setAttribute("selected", true) + $item.setAttribute("disabled", true) + } + $select.append($item) + }); + $form = document.createElement("form") + $form.setAttribute("autocomplete", "off") + $form.append($select) + $version.append($form) +} + +document.addEventListener("DOMContentLoaded", function () { + CrystalDocs.initializeVersions() +}) + +var UsageModal = function(title, content) { + var $body = document.body; + var self = this; + var $modalBackground = document.createElement("div"); + $modalBackground.classList.add("modal-background"); + var $usageModal = document.createElement("div"); + $usageModal.classList.add("usage-modal"); + $modalBackground.appendChild($usageModal); + var $title = document.createElement("h3"); + $title.classList.add("modal-title"); + $title.innerHTML = title + $usageModal.appendChild($title); + var $closeButton = document.createElement("span"); + $closeButton.classList.add("close-button"); + $closeButton.setAttribute("title", "Close modal"); + $closeButton.innerText = '×'; + $usageModal.appendChild($closeButton); + $usageModal.insertAdjacentHTML("beforeend", content); + + $modalBackground.addEventListener('click', function(event) { + var element = event.target || event.srcElement; + + if(element == $modalBackground) { + self.hide(); + } + }); + $closeButton.addEventListener('click', function(event) { + self.hide(); + }); + + $body.insertAdjacentElement('beforeend', $modalBackground); + + this.show = function(){ + $body.classList.add("js-modal-visible"); + }; + this.hide = function(){ + $body.classList.remove("js-modal-visible"); + }; + this.isVisible = function(){ + return $body.classList.contains("js-modal-visible"); + } +} + + +document.addEventListener('DOMContentLoaded', function() { + var sessionStorage; + try { + sessionStorage = window.sessionStorage; + } catch (e) { } + if(!sessionStorage) { + sessionStorage = { + setItem: function() {}, + getItem: function() {}, + removeItem: function() {} + }; + } + + var repositoryName = document.querySelector('[name=repository-name]').getAttribute('content'); + var typesList = document.querySelector('.types-list'); + var searchInput = document.querySelector('.search-input'); + var parents = document.querySelectorAll('.types-list li.parent'); + + var scrollSidebarToOpenType = function(){ + var openTypes = typesList.querySelectorAll('.current'); + if (openTypes.length > 0) { + var lastOpenType = openTypes[openTypes.length - 1]; + lastOpenType.scrollIntoView(!(window.matchMedia('only screen and (max-width: 635px)')).matches); + } + } + + scrollSidebarToOpenType(); + + var setPersistentSearchQuery = function(value){ + sessionStorage.setItem(repositoryName + '::search-input:value', value); + } + + for(var i = 0; i < parents.length; i++) { + var _parent = parents[i]; + _parent.addEventListener('click', function(e) { + e.stopPropagation(); + + if(e.target.tagName.toLowerCase() == 'li') { + if(e.target.className.match(/open/)) { + sessionStorage.removeItem(e.target.getAttribute('data-id')); + e.target.className = e.target.className.replace(/ +open/g, ''); + } else { + sessionStorage.setItem(e.target.getAttribute('data-id'), '1'); + if(e.target.className.indexOf('open') == -1) { + e.target.className += ' open'; + } + } + } + }); + + if(sessionStorage.getItem(_parent.getAttribute('data-id')) == '1') { + _parent.className += ' open'; + } + } + + var leaveSearchScope = function(){ + CrystalDocs.toggleResultsList(false); + window.focus(); + } + + var navigator = new Navigator(document.querySelector('.types-list'), searchInput, document.querySelector(".search-results"), leaveSearchScope); + + CrystalDocs.loadIndex(); + var searchTimeout; + var lastSearchText = false; + var performSearch = function() { + document.dispatchEvent(new Event("CrystalDocs:searchDebounceStarted")); + + clearTimeout(searchTimeout); + searchTimeout = setTimeout(function() { + var text = searchInput.value; + + if(text == "") { + CrystalDocs.toggleResultsList(false); + }else if(text == lastSearchText){ + document.dispatchEvent(new Event("CrystalDocs:searchDebounceStopped")); + }else{ + CrystalDocs.search(text); + navigator.highlightFirst(); + searchInput.focus(); + } + lastSearchText = text; + setPersistentSearchQuery(text); + }, 200); + }; + + if(location.hash.length > 3 && location.hash.substring(0,3) == "#q="){ + // allows directly linking a search query which is then executed on the client + // this comes handy for establishing a custom browser search engine with https://crystal-lang.org/api/#q=%s as a search URL + // TODO: Add OpenSearch description + var searchQuery = location.hash.substring(3); + history.pushState({searchQuery: searchQuery}, "Search for " + searchQuery, location.href.replace(/#q=.*/, "")); + searchInput.value = searchQuery; + document.addEventListener('CrystalDocs:loaded', performSearch); + } + + if (searchInput.value.length == 0) { + var searchText = sessionStorage.getItem(repositoryName + '::search-input:value'); + if(searchText){ + searchInput.value = searchText; + } + } + searchInput.addEventListener('keyup', performSearch); + searchInput.addEventListener('input', performSearch); + + var usageModal = new UsageModal('Keyboard Shortcuts', '' + + '' + ); + + function handleShortkeys(event) { + var element = event.target || event.srcElement; + + if(element.tagName == "INPUT" || element.tagName == "TEXTAREA" || element.parentElement.tagName == "TEXTAREA"){ + return; + } + + switch(event.key) { + case "?": + usageModal.show(); + break; + + case "Escape": + usageModal.hide(); + break; + + case "s": + case "/": + if(usageModal.isVisible()) { + return; + } + event.stopPropagation(); + navigator.focus(); + performSearch(); + break; + } + } + + document.addEventListener('keyup', handleShortkeys); + + var scrollToEntryFromLocationHash = function() { + var hash = window.location.hash; + if (hash) { + var targetAnchor = decodeURI(hash.substr(1)); + var targetEl = document.getElementById(targetAnchor) + if (targetEl) { + targetEl.offsetParent.scrollTop = targetEl.offsetTop; + } + } + }; + window.addEventListener("hashchange", scrollToEntryFromLocationHash, false); + scrollToEntryFromLocationHash(); +}); diff --git a/search-index.js b/search-index.js new file mode 100644 index 0000000..bb9a5cb --- /dev/null +++ b/search-index.js @@ -0,0 +1 @@ +crystal_doc_search_index_callback({"repository_name":"geojson","body":"# GeoJSON\n\n[![Crystal CI](https://github.com/geocrystal/geojson/actions/workflows/crystal.yml/badge.svg)](https://github.com/geocrystal/geojson/actions/workflows/crystal.yml)\n[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://geocrystal.github.io/geojson/)\n[![License](https://img.shields.io/github/license/geocrystal/geojson.svg)](https://github.com/geocrystal/geojson/blob/master/LICENSE)\n\nCrystal library for reading and writing [GeoJSON](https://tools.ietf.org/html/rfc7946)\n\nThis library contains:\n\n- Functions for encoding and decoding GeoJSON formatted data\n- Classes for all GeoJSON Objects\n- Allow \"foreign members\" in a GeoJSON Objects\n\n## Installation\n\nAdd the dependency to your `shard.yml`:\n\n```yaml\ndependencies:\n geojson:\n github: geocrystal/geojson\n```\n\nand run `shards install`\n\n```crystal\nrequire \"geojson\"\n```\n\n## Position\n\nA position is the fundamental geometry construct. The `coordinates` member of a Geometry object is composed of either:\n\n- one position in the case of a `Point` geometry\n- an array of positions in the case of a `LineString` or `MultiPoint` geometry\n- an array of `LineString` or linear ring coordinates in the case of a `Polygon` or `MultiLineString` geometry\n- an array of `Polygon` coordinates in the case of a `MultiPolygon` geometry\n\nA position is an array of `Float64`.\n\nThere __must__ be two or more elements. The first two elements are `longitude` and `latitude`. `Altitude` __may__ be included as an optional third element.\n\n```crystal\npostition = [-80.1347334, 25.7663562, 0.0]\npoint = GeoJSON::Point.new(position)\n```\n\n## GeoJSON types\n\n### Point\n\nA GeoJSON point looks like this:\n\n```json\n{\n \"type\": \"Point\",\n \"coordinates\": [-80.1347334, 25.7663562]\n}\n```\n\nIt is important to note that coordinates is in the format `[longitude, latitude]`.\nLongitude comes before latitude in GeoJSON.\n\nFor type `Point`, the `coordinates` member is a single position.\n\nSerialize geometry type:\n\n```crystal\npoint = GeoJSON::Point.new([-80.1347334, 25.7663562])\njson = point.to_json\n# => {\"type\":\"Point\",\"coordinates\":[-80.1347334,25.7663562]}\n```\n\nDeserialize geometry type:\n\n```crystal\npoint = GeoJSON::Point.from_json(json)\n# => #\npoint.longitude\n# => -80.1347334\npoint.latitude\n# => 25.7663562\n```\n\n### MultiPoint\n\nFor type `MultiPoint`, the `coordinates` member is an array of positions.\n\n```crystal\npoint1 = GeoJSON::Point.new(longitude: 100.0, latitude: 0.0)\npoint2 = GeoJSON::Point.new(longitude: 101.0, latitude: 1.0)\n\nmulti_point = GeoJSON::MultiPoint.new([point1, point2])\nmulti_point.to_json\n```\n\n```json\n{\n \"type\":\"MultiPoint\",\n \"coordinates\":[[100.0, 0.0], [101.0, 1.0]]\n}\n```\n\n### LineString\n\nFor type `LineString`, the `coordinates` member is an array of two or more positions.\n\n```crystal\nline_string = GeoJSON::LineString.new [[-124.2, 42.0], [-120.0, 42.0]]\nline_string.to_json\n```\n\n```json\n{\n \"type\": \"LineString\",\n \"coordinates\": [[-124.2, 42.0], [-120.0, 42.0]]\n}\n```\n\n### MultiLineString\n\nFor type `MultiLineString`, the `coordinates` member is an array of `LineString` coordinate arrays.\n\n```crystal\nline_string1 = GeoJSON::LineString.new([[100.0, 0.0], [101.0, 1.0]])\nline_string2 = GeoJSON::LineString.new([[102.0, 2.0], [103.0, 3.0]])\n\nmulti_line_string = GeoJSON::MultiLineString.new([line_string1, line_string2])\n```\n\n```crystal\nmulti_line_string = GeoJSON::MultiLineString.new([\n [[100.0, 0.0], [101.0, 1.0]],\n [[102.0, 2.0], [103.0, 3.0]],\n])\nmulti_line_string.to_json\n```\n\n```json\n{\n \"type\":\"MultiLineString\",\n \"coordinates\":[\n [\n [100.0, 0.0],\n [101.0, 1.0]\n ],\n [\n [102.0, 2.0],\n [103.0, 3.0]\n ]\n ]\n}\n```\n\n### Polygon\n\nGeoJSON polygons represent closed shapes on a map, like triangles, squares, dodecagons, or any shape with a fixed number of sides.\n\nTo specify a constraint specific to `Polygon`, it is useful to introduce the concept of a linear ring:\n\n- A linear ring is a closed `LineString` with four or more positions.\n- The first and last positions are equivalent, and they __must__ contain identical values; their representation __should__ also be identical.\n- A linear ring is the boundary of a surface or the boundary of a hole in a surface.\n- A linear ring __must__ follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.\n\nThe `Polygon` geometry type definition as follows:\n\n- For type `Polygon`, the `coordinates` member __must__ be an array of linear ring coordinate arrays.\n- For `Polygon` with more than one of these rings, the first __must__ be the exterior ring, and any others __must__ be interior rings. The exterior ring bounds the surface, and the interior rings (if present) bound holes within the surface.\n\n```crystal\npolygon = GeoJSON::Polygon.new([\n [[-10.0, -10.0], [10.0, -10.0], [10.0, 10.0], [-10.0,-10.0]],\n [[-1.0, -2.0], [3.0, -2.0], [3.0, 2.0], [-1.0,-2.0]]\n])\npolygon.to_json\n```\n\n```json\n{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [-10.0, -10.0],\n [10.0, -10.0],\n [10.0,10.0],\n [-10.0,-10.0]\n ],\n [\n [-1.0, -2.0],\n [3.0, -2.0],\n [3.0, 2.0],\n [-1.0,-2.0]\n ]\n ]\n}\n```\n\n### MultiPolygon\n\nFor type `MultiPolygon`, the `coordinates` member is an array of `Polygon` coordinate arrays.\n\n```crystal\npolygon1 = GeoJSON::Polygon.new(\n [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]]\n)\npolygon2 = GeoJSON::Polygon.new(\n [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]\n)\n\nmulti_polygon = GeoJSON::MultiPolygon.new([polygon1, polygon2])\nmulti_polygon.to_json\n```\n\n```json\n{\n \"type\":\"MultiPolygon\",\n \"coordinates\":[\n [\n [\n [102.0,2.0],\n [103.0,2.0],\n [103.0,3.0],\n [102.0,3.0],\n [102.0,2.0]\n ]\n ],\n [\n [\n [100.0,0.0],\n [101.0,0.0],\n [101.0,1.0],\n [100.0,1.0],\n [100.0,0.0]\n ]\n ]\n ]\n}\n```\n\n### GeometryCollection\n\nA GeoJSON object with type `GeometryCollection` is a Geometry object.\n\nA `GeometryCollection` has a member with the name `geometries`. The\nvalue of `geometries` is an array. Each element of this array is a\nGeoJSON Geometry object.\n\n```crystal\npoint = GeoJSON::Point.new([100.0, 0.0])\nline_string = GeoJSON::LineString.new([\n [101.0, 0.0],\n [102.0, 1.0],\n])\npolygon = GeoJSON::Polygon.new([\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n])\n\ngeometry_collection = GeoJSON::GeometryCollection.new([point, line_string, polygon])\ngeometry_collection.to_json\n```\n\n```json\n{\n \"type\":\"GeometryCollection\",\n \"geometries\":[\n {\n \"type\":\"Point\",\n \"coordinates\":[100.0,0.0]\n },\n {\n \"type\":\"LineString\",\n \"coordinates\":[\n [101.0,0.0],\n [102.0,1.0]\n ]\n },\n {\n \"type\":\"Polygon\",\n \"coordinates\":[\n [\n [100.0,0.0],\n [101.0,0.0],\n [101.0,1.0],\n [100.0,1.0],\n [100.0,0.0]\n ]\n ]\n }\n ]\n}\n```\n\n### Feature\n\nA `Feature` object represents a spatially bounded thing. Every `Feature` object is a GeoJSON object no matter where it occurs in a GeoJSON text.\n\n- A `Feature` object has a `\"type\"` member with the value `\"Feature\"`.\n- A `Feature` object has a member with the name `\"geometry\"`. The value of the geometry member __shall__ be either a Geometry object as defined above or, in the case that the `Feature` is unlocated, a JSON `null` value.\n- A `Feature` object has a member with the name `\"properties\"`. The value of the properties member is an object (any JSON object or a JSON `null` value).\n- If a `Feature` has a commonly used identifier, that identifier __should__ be included as a member of the `Feature` object with the name `\"id\"`, and the value of this member is either a JSON string or number.\n\n```crystal\npoint = GeoJSON::Point.new([-80.1347334, 25.7663562])\nproperties = {\"color\" => \"red\"} of String => JSON::Any::Type\nfeature = GeoJSON::Feature.new(point, properties, id: 1)\nfeature.to_json\n```\n\n```json\n{\n \"type\":\"Feature\",\n \"geometry\":{\n \"type\":\"Point\",\n \"coordinates\":[-80.1347334,25.7663562]\n },\n \"properties\":{\n \"color\":\"red\"\n },\n \"id\":1\n}\n```\n\n### FeatureCollection\n\nA GeoJSON object with the type `\"FeatureCollection\"` is a `FeatureCollection` object. A `FeatureCollection` object has a member with the name `\"features\"`. The value of `\"features\"` is a JSON array. Each element of the array is a `Feature` object. It is possible for this array to be empty.\n\n```crystal\nfeature1 = GeoJSON::Feature.new(\n GeoJSON::Point.new([102.0, 0.5]),\n id: \"point\"\n)\n\nfeature2 = GeoJSON::Feature.new(\n GeoJSON::Polygon.new([\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n ]),\n type: \"polygon\"\n)\n\nfeature_collection = GeoJSON::FeatureCollection.new([feature1, feature2])\nfeature_collection.to_json\n```\n\n```json\n{\n \"type\":\"FeatureCollection\",\n \"features\":[\n {\n \"type\":\"Feature\",\n \"geometry\":{\n \"type\":\"Point\",\n \"coordinates\":[102.0,0.5]\n },\n \"properties\":null,\n \"id\":\"point\"\n },\n {\n \"type\":\"Feature\",\n \"geometry\":{\n \"type\":\"Polygon\",\n \"coordinates\":[\n [\n [100.0,0.0],\n [101.0,0.0],\n [101.0,1.0],\n [100.0,1.0],\n [100.0,0.0]\n ]\n ]\n },\n \"properties\":null,\n \"id\":\"polygon\"\n }\n ]\n}\n```\n\n## Foreign Members\n\nFor example, in the `Point` object shown below\n\n```json\n{\n \"type\": \"Point\",\n \"coordinates\": [-80.1347334, 25.7663562],\n \"title\": \"Example Point\"\n}\n```\n\nthe name/value pair of `\"title\": \"Example Point\"` is a foreign member.\n\nGeoJSON semantics do not apply to foreign members and their descendants, regardless of their names and values.\n\nIf the GeoJSON type include foreign members, this properties in the JSON document will be stored in a `Hash(String, JSON::Any)`.\nOn serialization, any keys inside `json_unmapped` will be serialized and appended to the current json object.\n\n```crystal\npoint = GeoJSON::Point.new([-80.1347334, 25.7663562])\n\njson_unmapped = Hash(String, JSON::Any).new\njson_unmapped[\"title\"] = JSON::Any.new(\"Example Point\")\n\npoint.json_unmapped = json_unmapped\n```\n\n## Contributing\n\n1. Fork it ()\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer\n\n## License\n\nCopyright: 2020-2022 Anton Maminov (anton.maminov@gmail.com)\n\nThis library is distributed under the MIT license. Please see the LICENSE file.\n","program":{"html_id":"geojson/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"geojson","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"geojson/GeoJSON","path":"GeoJSON.html","kind":"module","full_name":"GeoJSON","name":"GeoJSON","abstract":false,"locations":[{"filename":"src/geojson.cr","line_number":15,"url":null},{"filename":"src/geojson/coordinates.cr","line_number":1,"url":null},{"filename":"src/geojson/exception.cr","line_number":1,"url":null},{"filename":"src/geojson/feature.cr","line_number":3,"url":null},{"filename":"src/geojson/feature_collection.cr","line_number":1,"url":null},{"filename":"src/geojson/geometry_collection.cr","line_number":1,"url":null},{"filename":"src/geojson/line_string.cr","line_number":1,"url":null},{"filename":"src/geojson/multi_line_string.cr","line_number":1,"url":null},{"filename":"src/geojson/multi_point.cr","line_number":1,"url":null},{"filename":"src/geojson/multi_polygon.cr","line_number":1,"url":null},{"filename":"src/geojson/object.cr","line_number":1,"url":null},{"filename":"src/geojson/point.cr","line_number":1,"url":null},{"filename":"src/geojson/polygon.cr","line_number":1,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /__w/geojson/geojson/src`).chomp.stringify }}"}],"types":[{"html_id":"geojson/GeoJSON/Coordinates","path":"GeoJSON/Coordinates.html","kind":"class","full_name":"GeoJSON::Coordinates","name":"Coordinates","abstract":false,"superclass":{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/coordinates.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Coordinates` is a position in longitude, latitude, and (optionally)\naltitude.\n\nThis class corresponds to the [GeoJSON Position](https://tools.ietf.org/html/rfc7946#section-3.1.1).","summary":"

A Coordinates is a position in longitude, latitude, and (optionally) altitude.

","constructors":[{"html_id":"new(longitude:Float64,latitude:Float64,altitude:Float64|Nil=nil)-class-method","name":"new","doc":"Creates a new `Coordinates` with the given *longitude*, *latitude* and *altitude*.","summary":"

Creates a new Coordinates with the given longitude, latitude and altitude.

","abstract":false,"args":[{"name":"longitude","external_name":"longitude","restriction":"Float64"},{"name":"latitude","external_name":"latitude","restriction":"Float64"},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":"Float64 | ::Nil"}],"args_string":"(longitude : Float64, latitude : Float64, altitude : Float64 | Nil = nil)","args_html":"(longitude : Float64, latitude : Float64, altitude : Float64 | Nil = nil)","location":{"filename":"src/geojson/coordinates.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"longitude","external_name":"longitude","restriction":"Float64"},{"name":"latitude","external_name":"latitude","restriction":"Float64"},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":"Float64 | ::Nil"}],"visibility":"Public","body":"if altitude\n new([longitude, latitude, altitude])\nelse\n new([longitude, latitude])\nend"}},{"html_id":"new(coordinates:Array(Float64))-class-method","name":"new","doc":"Creates a new `Coordinates` with the given *coordinates* array.","summary":"

Creates a new Coordinates with the given coordinates array.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"}],"args_string":"(coordinates : Array(Float64))","args_html":"(coordinates : Array(Float64))","location":{"filename":"src/geojson/coordinates.cr","line_number":10,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(parser:JSON::PullParser)-class-method","name":"new","doc":"Deserializes a `Coordinates` from the given JSON *parser*.","summary":"

Deserializes a Coordinates from the given JSON parser.

","abstract":false,"args":[{"name":"parser","external_name":"parser","restriction":"JSON::PullParser"}],"args_string":"(parser : JSON::PullParser)","args_html":"(parser : JSON::PullParser)","location":{"filename":"src/geojson/coordinates.cr","line_number":15,"url":null},"def":{"name":"new","args":[{"name":"parser","external_name":"parser","restriction":"JSON::PullParser"}],"visibility":"Public","body":"coordinates = Array(Float64).new(parser)\nnew(coordinates)\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

Returns true if this reference is the same as other.

","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif coordinates == other.coordinates\nelse\n return false\nend\ntrue\n"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/coordinates.cr","line_number":30,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/coordinates.cr","line_number":30,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"altitude-instance-method","name":"altitude","doc":"Gets this Coordinates' altitude.\n\nTechnically, this positional value is meant to be the height in meters\nabove the WGS84 ellipsoid.","summary":"

Gets this Coordinates' altitude.

","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":46,"url":null},"def":{"name":"altitude","visibility":"Public","body":"coordinates[2]?"}},{"html_id":"coordinates:Array(Float64)-instance-method","name":"coordinates","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":7,"url":null},"def":{"name":"coordinates","return_type":"Array(Float64)","visibility":"Public","body":"@coordinates"}},{"html_id":"hash(hasher)-instance-method","name":"hash","doc":"See `Object#hash(hasher)`","summary":"

See Object#hash(hasher)

","abstract":false,"args":[{"name":"hasher","external_name":"hasher","restriction":""}],"args_string":"(hasher)","args_html":"(hasher)","def":{"name":"hash","args":[{"name":"hasher","external_name":"hasher","restriction":""}],"visibility":"Public","body":"hasher = coordinates.hash(hasher)\nhasher\n"}},{"html_id":"latitude-instance-method","name":"latitude","doc":"Gets this Coordinates' latitude in decimal degrees according to WGS84.","summary":"

Gets this Coordinates' latitude in decimal degrees according to WGS84.

","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":38,"url":null},"def":{"name":"latitude","visibility":"Public","body":"coordinates[1]"}},{"html_id":"longitude-instance-method","name":"longitude","doc":"Gets this Coordinates' longitude in decimal degrees according to WGS84.","summary":"

Gets this Coordinates' longitude in decimal degrees according to WGS84.

","abstract":false,"location":{"filename":"src/geojson/coordinates.cr","line_number":33,"url":null},"def":{"name":"longitude","visibility":"Public","body":"coordinates[0]"}},{"html_id":"to_json(*args,**options)-instance-method","name":"to_json","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/coordinates.cr","line_number":56,"url":null},"def":{"name":"to_json","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.to_json(*args, **options)"}},{"html_id":"to_json(*args,**options,&)-instance-method","name":"to_json","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/coordinates.cr","line_number":56,"url":null},"def":{"name":"to_json","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.to_json(*args, **options) do |*yield_args|\n yield *yield_args\nend"}}]},{"html_id":"geojson/GeoJSON/Exception","path":"GeoJSON/Exception.html","kind":"class","full_name":"GeoJSON::Exception","name":"Exception","abstract":false,"superclass":{"html_id":"geojson/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"geojson/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/exception.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"Raised when an attempt is made to create a GeoJSON object that is malformed.\n\nIn most cases, this means that the given coordinates for a geometry object\ndon't fulfill the requirements for that geometry type.","summary":"

Raised when an attempt is made to create a GeoJSON object that is malformed.

"},{"html_id":"geojson/GeoJSON/Feature","path":"GeoJSON/Feature.html","kind":"class","full_name":"GeoJSON::Feature","name":"Feature","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/feature.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Feature` represents a [GeoJSON Feature object](https://tools.ietf.org/html/rfc7946#section-3.2)\nwith a geometry and properties.","summary":"

A Feature represents a GeoJSON Feature object with a geometry and properties.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `Feature` represents a [GeoJSON Feature object](https://tools.ietf.org/html/rfc7946#section-3.2)\nwith a geometry and properties.","summary":"

A Feature represents a GeoJSON Feature object with a geometry and properties.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/feature.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(geometry:GeoJSON::Object|Nil,properties:Nil|Hash(String,Array(JSON::Any)|Bool|Float64|Hash(String,JSON::Any)|Int64|String|Nil)=nil,*,id:Int32|String|Nil=nil,bbox=nil)-class-method","name":"new","doc":"Creates a new `Feature` with the given *geometry* and optional\n*properties*, *id*, and bounding box *bbox*.","summary":"

Creates a new Feature with the given geometry and optional properties, id, and bounding box bbox.

","abstract":false,"args":[{"name":"geometry","external_name":"geometry","restriction":"::GeoJSON::Object | ::Nil"},{"name":"properties","default_value":"nil","external_name":"properties","restriction":"::Nil | ::Hash(::String, ::Array(::JSON::Any) | ::Bool | ::Float64 | ::Hash(::String, ::JSON::Any) | ::Int64 | ::String | ::Nil)"},{"name":"","external_name":"","restriction":""},{"name":"id","default_value":"nil","external_name":"id","restriction":"::Int32 | ::String | ::Nil"},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(geometry : GeoJSON::Object | Nil, properties : Nil | Hash(String, Array(JSON::Any) | Bool | Float64 | Hash(String, JSON::Any) | Int64 | String | Nil) = nil, *, id : Int32 | String | Nil = nil, bbox = nil)","args_html":"(geometry : GeoJSON::Object | Nil, properties : Nil | Hash(String, Array(JSON::Any) | Bool | Float64 | Hash(String, JSON::Any) | Int64 | String | Nil) = nil, *, id : Int32 | String | Nil = nil, bbox = nil)","location":{"filename":"src/geojson/feature.cr","line_number":23,"url":null},"def":{"name":"new","args":[{"name":"geometry","external_name":"geometry","restriction":"::GeoJSON::Object | ::Nil"},{"name":"properties","default_value":"nil","external_name":"properties","restriction":"::Nil | ::Hash(::String, ::Array(::JSON::Any) | ::Bool | ::Float64 | ::Hash(::String, ::JSON::Any) | ::Int64 | ::String | ::Nil)"},{"name":"","external_name":"","restriction":""},{"name":"id","default_value":"nil","external_name":"id","restriction":"::Int32 | ::String | ::Nil"},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":2,"visibility":"Public","body":"_ = allocate\n_.initialize(geometry, properties, id: id, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":26,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\ngeometry.try(&.bbox)\n"}},{"html_id":"geometry:GeoJSON::Object::Type|Nil-instance-method","name":"geometry","doc":"Gets this Feature's geometry.","summary":"

Gets this Feature's geometry.

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":12,"url":null},"def":{"name":"geometry","return_type":"GeoJSON::Object::Type | ::Nil","visibility":"Public","body":"@geometry"}},{"html_id":"id:String|Int32|Nil-instance-method","name":"id","doc":"Gets this Feature's id.","summary":"

Gets this Feature's id.

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":19,"url":null},"def":{"name":"id","return_type":"String | Int32 | Nil","visibility":"Public","body":"@id"}},{"html_id":"properties:Hash(String,JSON::Any::Type)|Nil-instance-method","name":"properties","doc":"Gets this Feature's properties.","summary":"

Gets this Feature's properties.

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":16,"url":null},"def":{"name":"properties","return_type":"Hash(String, JSON::Any::Type) | ::Nil","visibility":"Public","body":"@properties"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this Feature's GeoJSON type (\"Feature\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/FeatureCollection","path":"GeoJSON/FeatureCollection.html","kind":"class","full_name":"GeoJSON::FeatureCollection","name":"FeatureCollection","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/feature_collection.cr","line_number":4,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `FeatureCollection` represents a [GeoJSON FeatureCollection object](https://tools.ietf.org/html/rfc7946#section-3.3)\nand contains one or more `Feature`s.","summary":"

A FeatureCollection represents a GeoJSON FeatureCollection object and contains one or more Features.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `FeatureCollection` represents a [GeoJSON FeatureCollection object](https://tools.ietf.org/html/rfc7946#section-3.3)\nand contains one or more `Feature`s.","summary":"

A FeatureCollection represents a GeoJSON FeatureCollection object and contains one or more Features.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/feature_collection.cr","line_number":4,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(features:Array(Feature),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `FeatureCollection` with the given *features*.","summary":"

Creates a new FeatureCollection with the given features.

","abstract":false,"args":[{"name":"features","external_name":"features","restriction":"Array(Feature)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(features : Array(Feature), *, bbox = nil)","args_html":"(features : Array(Feature), *, bbox = nil)","location":{"filename":"src/geojson/feature_collection.cr","line_number":12,"url":null},"def":{"name":"new","args":[{"name":"features","external_name":"features","restriction":"Array(Feature)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(features, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature_collection.cr","line_number":15,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\nfeatures.each do |feature|\n feature.bbox.try do |feature_bbox|\n if result[0] > feature_bbox[0]\n result[0] = feature_bbox[0]\n end\n if result[1] > feature_bbox[1]\n result[1] = feature_bbox[1]\n end\n if result[2] < feature_bbox[2]\n result[2] = feature_bbox[2]\n end\n if result[3] < feature_bbox[3]\n result[3] = feature_bbox[3]\n end\n end\nend\nresult\n"}},{"html_id":"features:Array(Feature)-instance-method","name":"features","doc":"Returns this `FeatureCollections` array of features.","summary":"

Returns this FeatureCollections array of features.

","abstract":false,"location":{"filename":"src/geojson/feature_collection.cr","line_number":9,"url":null},"def":{"name":"features","return_type":"Array(Feature)","visibility":"Public","body":"@features"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this FeatureCollection's GeoJSON type (\"FeatureCollection\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/feature_collection.cr","line_number":6,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/GeometryCollection","path":"GeoJSON/GeometryCollection.html","kind":"class","full_name":"GeoJSON::GeometryCollection","name":"GeometryCollection","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/geometry_collection.cr","line_number":10,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `GeometryCollection` represents a collection of several geometries.\n\nIts array of geometries can contain `Point`, `MultiPoint`, `LineString`,\n`MultiLineString`, `Polygon`, and `MultiPolygon`. Technically, you can nest\n`GeometryCollection`s inside one another, but this is discouraged by the\nspecification.\n\nThis class corresponds to the [GeoJSON GeometryCollection](https://tools.ietf.org/html/rfc7946#section-3.1.8).","summary":"

A GeometryCollection represents a collection of several geometries.

","class_methods":[{"html_id":"read_geometries(pull:JSON::PullParser)-class-method","name":"read_geometries","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/geometry_collection.cr","line_number":39,"url":null},"def":{"name":"read_geometries","args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"visibility":"Public","body":"geometries = [] of GeoJSON::Object::Type\npull.read_begin_array\nwhile !pull.kind.end_array?\n case pull.kind\n when .begin_object?\n if geometry = GeoJSON::Object.new(pull)\n geometries << geometry\n end\n else\n pull.read_next\n end\nend\ngeometries\n"}}],"constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"Deserializes a `GeometryCollection` from the given JSON *parser*.","summary":"

Deserializes a GeometryCollection from the given JSON parser.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/geometry_collection.cr","line_number":24,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"JSON::PullParser"}],"visibility":"Public","body":"geometries = [] of GeoJSON::Object::Type\npull.read_begin_object\nwhile !pull.kind.end_object?\n if pull.kind.string? && (pull.read_string == \"geometries\")\n geometries = read_geometries(pull)\n else\n pull.read_next\n end\nend\nGeoJSON::GeometryCollection.new(geometries)\n"}},{"html_id":"new(geometries:Array(GeoJSON::Object::Type),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `GeometryCollection` containing the given *geometries* and\noptional bounding box *bbox*.","summary":"

Creates a new GeometryCollection containing the given geometries and optional bounding box bbox.

","abstract":false,"args":[{"name":"geometries","external_name":"geometries","restriction":"Array(GeoJSON::Object::Type)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(geometries : Array(GeoJSON::Object::Type), *, bbox = nil)","args_html":"(geometries : Array(GeoJSON::Object::Type), *, bbox = nil)","location":{"filename":"src/geojson/geometry_collection.cr","line_number":19,"url":null},"def":{"name":"new","args":[{"name":"geometries","external_name":"geometries","restriction":"Array(GeoJSON::Object::Type)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(geometries, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/geometry_collection.cr","line_number":58,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\ngeometries.each do |object|\n object.bbox.try do |object_bbox|\n if result[0] > object_bbox[0]\n result[0] = object_bbox[0]\n end\n if result[1] > object_bbox[1]\n result[1] = object_bbox[1]\n end\n if result[2] < object_bbox[2]\n result[2] = object_bbox[2]\n end\n if result[3] < object_bbox[3]\n result[3] = object_bbox[3]\n end\n end\nend\nresult\n"}},{"html_id":"geometries:Array(GeoJSON::Object::Type)-instance-method","name":"geometries","doc":"Returns an array of the geometries in this `GeometryCollection`","summary":"

Returns an array of the geometries in this GeometryCollection

","abstract":false,"location":{"filename":"src/geojson/geometry_collection.cr","line_number":15,"url":null},"def":{"name":"geometries","return_type":"Array(GeoJSON::Object::Type)","visibility":"Public","body":"@geometries"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this GeometryCollection's GeoJSON type (\"GeometryCollection\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/geometry_collection.cr","line_number":12,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/LineString","path":"GeoJSON/LineString.html","kind":"class","full_name":"GeoJSON::LineString","name":"LineString","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/line_string.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `LineString` is a `Geometry` representing two or more points in geographic\nspace connected consecutively by lines.\n\nThis class corresponds to the [GeoJSON LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4).","summary":"

A LineString is a Geometry representing two or more points in geographic space connected consecutively by lines.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `LineString` is a `Geometry` representing two or more points in geographic\nspace connected consecutively by lines.\n\nThis class corresponds to the [GeoJSON LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4).","summary":"

A LineString is a Geometry representing two or more points in geographic space connected consecutively by lines.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/line_string.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Coordinates),*,bbox=nil)-class-method","name":"new","doc":"Create a new `LineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new LineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Coordinates)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Coordinates), *, bbox = nil)","args_html":"(coordinates : Array(Coordinates), *, bbox = nil)","location":{"filename":"src/geojson/line_string.cr","line_number":18,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Coordinates)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Point),*,bbox=nil)-class-method","name":"new","doc":"Create a new `LineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new LineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Point), *, bbox = nil)","args_html":"(coordinates : Array(Point), *, bbox = nil)","location":{"filename":"src/geojson/line_string.cr","line_number":23,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Float64)),*,bbox=nil)-class-method","name":"new","doc":"Create a new `LineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new LineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Float64)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Float64)), *, bbox = nil)","location":{"filename":"src/geojson/line_string.cr","line_number":30,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the LineString vertex at the given index.","summary":"

Gets the LineString vertex at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/line_string.cr","line_number":14,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the LineString vertex at the given index.","summary":"

Gets the LineString vertex at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/line_string.cr","line_number":14,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/line_string.cr","line_number":36,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Coordinates)-instance-method","name":"coordinates","doc":"Gets this LineString's GeoJSON type (\"LineString\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/line_string.cr","line_number":11,"url":null},"def":{"name":"coordinates","return_type":"Array(Coordinates)","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this LineString's GeoJSON type (\"LineString\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/line_string.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/MultiLineString","path":"GeoJSON/MultiLineString.html","kind":"class","full_name":"GeoJSON::MultiLineString","name":"MultiLineString","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/multi_line_string.cr","line_number":5,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `MultiLineString` is a `Geometry` representing several `LineString`s.\n\nThis class corresponds to the [GeoJSON MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5).","summary":"

A MultiLineString is a Geometry representing several LineStrings.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `MultiLineString` is a `Geometry` representing several `LineString`s.\n\nThis class corresponds to the [GeoJSON MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5).","summary":"

A MultiLineString is a Geometry representing several LineStrings.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":5,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(LineString),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiLineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiLineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(LineString)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(LineString), *, bbox = nil)","args_html":"(coordinates : Array(LineString), *, bbox = nil)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":17,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(LineString)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Array(Float64))),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiLineString` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiLineString with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","args_html":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"<<(line_string:Array(LineString))-instance-method","name":"<<","doc":"Adds the given *line_string* to this MultiLineString.","summary":"

Adds the given line_string to this MultiLineString.

","abstract":false,"args":[{"name":"line_string","external_name":"line_string","restriction":"Array(LineString)"}],"args_string":"(line_string : Array(LineString))","args_html":"(line_string : Array(LineString))","location":{"filename":"src/geojson/multi_line_string.cr","line_number":29,"url":null},"def":{"name":"<<","args":[{"name":"line_string","external_name":"line_string","restriction":"Array(LineString)"}],"visibility":"Public","body":"@coordinates << line_string"}},{"html_id":"<<(coordinate:Array(Array(Float64)))-instance-method","name":"<<","doc":"Adds the given *coordinate* to this MultiLineString.","summary":"

Adds the given coordinate to this MultiLineString.

","abstract":false,"args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Float64))"}],"args_string":"(coordinate : Array(Array(Float64)))","args_html":"(coordinate : Array(Array(Float64)))","location":{"filename":"src/geojson/multi_line_string.cr","line_number":34,"url":null},"def":{"name":"<<","args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Float64))"}],"visibility":"Public","body":"@coordinates << (LineString.new(coordinate)).coordinates"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the `LineString` at the given index.","summary":"

Gets the LineString at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the `LineString` at the given index.","summary":"

Gets the LineString at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/multi_line_string.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_line_string.cr","line_number":38,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |line|\n line.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Array(GeoJSON::Coordinates))-instance-method","name":"coordinates","doc":"Returns an array of this MultiLineString's coordinates.","summary":"

Returns an array of this MultiLineString's coordinates.

","abstract":false,"location":{"filename":"src/geojson/multi_line_string.cr","line_number":10,"url":null},"def":{"name":"coordinates","return_type":"Array(Array(GeoJSON::Coordinates))","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this MultiLineString's GeoJSON type (\"MultiLineString\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_line_string.cr","line_number":7,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/MultiPoint","path":"GeoJSON/MultiPoint.html","kind":"class","full_name":"GeoJSON::MultiPoint","name":"MultiPoint","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/multi_point.cr","line_number":5,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `MultiPoint` is a `Geometry` representing several `Point`s.\n\nThis class corresponds to the [GeoJSON MultiPoint](https://tools.ietf.org/html/rfc7946#section-3.1.3).","summary":"

A MultiPoint is a Geometry representing several Points.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `MultiPoint` is a `Geometry` representing several `Point`s.\n\nThis class corresponds to the [GeoJSON MultiPoint](https://tools.ietf.org/html/rfc7946#section-3.1.3).","summary":"

A MultiPoint is a Geometry representing several Points.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/multi_point.cr","line_number":5,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Point),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPoint` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPoint with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Point), *, bbox = nil)","args_html":"(coordinates : Array(Point), *, bbox = nil)","location":{"filename":"src/geojson/multi_point.cr","line_number":17,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Point)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Float64)),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPoint` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPoint with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Float64)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Float64)), *, bbox = nil)","location":{"filename":"src/geojson/multi_point.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Float64))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"<<(point:Array(Point))-instance-method","name":"<<","doc":"Adds the given *point* to this MultiPoint.","summary":"

Adds the given point to this MultiPoint.

","abstract":false,"args":[{"name":"point","external_name":"point","restriction":"Array(Point)"}],"args_string":"(point : Array(Point))","args_html":"(point : Array(Point))","location":{"filename":"src/geojson/multi_point.cr","line_number":29,"url":null},"def":{"name":"<<","args":[{"name":"point","external_name":"point","restriction":"Array(Point)"}],"visibility":"Public","body":"@coordinates << point.coordinates"}},{"html_id":"<<(coordinate:Array(Float64))-instance-method","name":"<<","doc":"Adds the given *coordinate* to this MultiPoint.","summary":"

Adds the given coordinate to this MultiPoint.

","abstract":false,"args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Float64)"}],"args_string":"(coordinate : Array(Float64))","args_html":"(coordinate : Array(Float64))","location":{"filename":"src/geojson/multi_point.cr","line_number":34,"url":null},"def":{"name":"<<","args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Float64)"}],"visibility":"Public","body":"@coordinates << (Point.new(coordinate)).coordinates"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the `Point` at the given index.","summary":"

Gets the Point at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/multi_point.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the `Point` at the given index.","summary":"

Gets the Point at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/multi_point.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_point.cr","line_number":38,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Coordinates)-instance-method","name":"coordinates","doc":"Returns an array of this MultiPoint's coordinates.","summary":"

Returns an array of this MultiPoint's coordinates.

","abstract":false,"location":{"filename":"src/geojson/multi_point.cr","line_number":10,"url":null},"def":{"name":"coordinates","return_type":"Array(Coordinates)","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this MultiPoint's GeoJSON type (\"MultiPoint\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_point.cr","line_number":7,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/MultiPolygon","path":"GeoJSON/MultiPolygon.html","kind":"class","full_name":"GeoJSON::MultiPolygon","name":"MultiPolygon","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/multi_polygon.cr","line_number":5,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `MultiPolygon` is a `Geometry` representing several `Polygon`s.\n\nThis class corresponds to the [GeoJSON MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7).","summary":"

A MultiPolygon is a Geometry representing several Polygons.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `MultiPolygon` is a `Geometry` representing several `Polygon`s.\n\nThis class corresponds to the [GeoJSON MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7).","summary":"

A MultiPolygon is a Geometry representing several Polygons.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":5,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Polygon),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPolygon` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPolygon with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Polygon)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Polygon), *, bbox = nil)","args_html":"(coordinates : Array(Polygon), *, bbox = nil)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":17,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Polygon)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Array(Array(Float64)))),*,bbox=nil)-class-method","name":"new","doc":"Create a new `MultiPolygon` with the given *coordinates* and optional\nbounding box *bbox*.","summary":"

Create a new MultiPolygon with the given coordinates and optional bounding box bbox.

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Array(Float64))))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Array(Array(Float64)))), *, bbox = nil)","args_html":"(coordinates : Array(Array(Array(Array(Float64)))), *, bbox = nil)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":22,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Array(Float64))))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"<<(polygon:Array(Polygon))-instance-method","name":"<<","doc":"Adds the given *polygon* to this MultiPolygon.","summary":"

Adds the given polygon to this MultiPolygon.

","abstract":false,"args":[{"name":"polygon","external_name":"polygon","restriction":"Array(Polygon)"}],"args_string":"(polygon : Array(Polygon))","args_html":"(polygon : Array(Polygon))","location":{"filename":"src/geojson/multi_polygon.cr","line_number":29,"url":null},"def":{"name":"<<","args":[{"name":"polygon","external_name":"polygon","restriction":"Array(Polygon)"}],"visibility":"Public","body":"@coordinates << polygon.coordinates"}},{"html_id":"<<(coordinate:Array(Array(Array(Float64))))-instance-method","name":"<<","doc":"Adds the given *coordinate* to this MultiPolygon.","summary":"

Adds the given coordinate to this MultiPolygon.

","abstract":false,"args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Array(Float64)))"}],"args_string":"(coordinate : Array(Array(Array(Float64))))","args_html":"(coordinate : Array(Array(Array(Float64))))","location":{"filename":"src/geojson/multi_polygon.cr","line_number":34,"url":null},"def":{"name":"<<","args":[{"name":"coordinate","external_name":"coordinate","restriction":"Array(Array(Array(Float64)))"}],"visibility":"Public","body":"@coordinates << (Polygon.new(coordinate)).coordinates"}},{"html_id":"[](*args,**options)-instance-method","name":"[]","doc":"Gets the `Polygon` at the given index.","summary":"

Gets the Polygon at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates[*args, **options]"}},{"html_id":"[](*args,**options,&)-instance-method","name":"[]","doc":"Gets the `Polygon` at the given index.","summary":"

Gets the Polygon at the given index.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/multi_polygon.cr","line_number":13,"url":null},"def":{"name":"[]","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.[](*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_polygon.cr","line_number":38,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |polygon|\n polygon.each do |ring|\n ring.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\n end\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Array(Array(GeoJSON::Coordinates)))-instance-method","name":"coordinates","doc":"Returns an array of this MultiPolygon's coordinates.","summary":"

Returns an array of this MultiPolygon's coordinates.

","abstract":false,"location":{"filename":"src/geojson/multi_polygon.cr","line_number":10,"url":null},"def":{"name":"coordinates","return_type":"Array(Array(Array(GeoJSON::Coordinates)))","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this MultiPolygon's GeoJSON type (\"MultiPolygon\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/multi_polygon.cr","line_number":7,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/Object","path":"GeoJSON/Object.html","kind":"class","full_name":"GeoJSON::Object","name":"Object","abstract":true,"superclass":{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/object.cr","line_number":14,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"}],"subclasses":[{"html_id":"geojson/GeoJSON/Feature","kind":"class","full_name":"GeoJSON::Feature","name":"Feature"},{"html_id":"geojson/GeoJSON/FeatureCollection","kind":"class","full_name":"GeoJSON::FeatureCollection","name":"FeatureCollection"},{"html_id":"geojson/GeoJSON/GeometryCollection","kind":"class","full_name":"GeoJSON::GeometryCollection","name":"GeometryCollection"},{"html_id":"geojson/GeoJSON/LineString","kind":"class","full_name":"GeoJSON::LineString","name":"LineString"},{"html_id":"geojson/GeoJSON/MultiLineString","kind":"class","full_name":"GeoJSON::MultiLineString","name":"MultiLineString"},{"html_id":"geojson/GeoJSON/MultiPoint","kind":"class","full_name":"GeoJSON::MultiPoint","name":"MultiPoint"},{"html_id":"geojson/GeoJSON/MultiPolygon","kind":"class","full_name":"GeoJSON::MultiPolygon","name":"MultiPolygon"},{"html_id":"geojson/GeoJSON/Point","kind":"class","full_name":"GeoJSON::Point","name":"Point"},{"html_id":"geojson/GeoJSON/Polygon","kind":"class","full_name":"GeoJSON::Polygon","name":"Polygon"}],"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"GeoJSON Object\n\nA GeoJSON object represents a Geometry, Feature, or collection of Features.\n\n* A GeoJSON object is a JSON object.\n* A GeoJSON object has a member with the name \"type\". The value of\n the member MUST be one of the GeoJSON types.\n `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`,\n `GeometryCollection`, `Feature`, and `FeatureCollection`\n* A GeoJSON object MAY have a \"bbox\" member, the value of which MUST\n be a bounding box array\n* A GeoJSON object MAY have other members","summary":"

GeoJSON Object

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/object.cr","line_number":28,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"location = pull.location\ndiscriminator_value = nil\njson = String.build do |io|\n JSON.build(io) do |builder|\n builder.start_object\n pull.read_object do |key|\n if key == \"type\"\n value_kind = pull.kind\n case value_kind\n when .string?\n discriminator_value = pull.string_value\n when .int?\n discriminator_value = pull.int_value\n when .bool?\n discriminator_value = pull.bool_value\n else\n raise(::JSON::SerializableError.new(\"JSON discriminator field 'type' has an invalid value type of #{value_kind.to_s}\", to_s, nil, *location, nil))\n end\n builder.field(key, discriminator_value)\n pull.read_next\n else\n builder.field(key) do\n pull.read_raw(builder)\n end\n end\n end\n builder.end_object\n end\nend\nif discriminator_value\nelse\n raise(::JSON::SerializableError.new(\"Missing JSON discriminator field 'type'\", to_s, nil, *location, nil))\nend\ncase discriminator_value\nwhen \"Point\"\n Point.from_json(json)\nwhen \"MultiPoint\"\n MultiPoint.from_json(json)\nwhen \"LineString\"\n LineString.from_json(json)\nwhen \"MultiLineString\"\n MultiLineString.from_json(json)\nwhen \"Polygon\"\n Polygon.from_json(json)\nwhen \"MultiPolygon\"\n MultiPolygon.from_json(json)\nelse\n raise(::JSON::SerializableError.new(\"Unknown 'type' discriminator value: #{discriminator_value.inspect}\", to_s, nil, *location, nil))\nend\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":true,"location":{"filename":"src/geojson/object.cr","line_number":26,"url":null},"def":{"name":"bbox","visibility":"Public","body":""}},{"html_id":"type:String-instance-method","name":"type","abstract":true,"location":{"filename":"src/geojson/object.cr","line_number":23,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":""}}],"types":[{"html_id":"geojson/GeoJSON/Object/Type","path":"GeoJSON/Object/Type.html","kind":"alias","full_name":"GeoJSON::Object::Type","name":"Type","abstract":false,"locations":[{"filename":"src/geojson/object.cr","line_number":21,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":true,"aliased":"GeoJSON::Object+","aliased_html":"GeoJSON::Object","const":false,"namespace":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"doc":"All possible GeoJSON types.","summary":"

All possible GeoJSON types.

"}]},{"html_id":"geojson/GeoJSON/Point","path":"GeoJSON/Point.html","kind":"class","full_name":"GeoJSON::Point","name":"Point","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/point.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Point` is a `Geometry` representing a single `Position` in geographic\nspace.\n\nThis class corresponds to the [GeoJSON Point](https://tools.ietf.org/html/rfc7946#section-3.1.2).","summary":"

A Point is a Geometry representing a single Position in geographic space.

","constructors":[{"html_id":"new(longitude,latitude,altitude=nil,bbox=nil)-class-method","name":"new","doc":"Creates a new `Point` at the given *longitude*, *latitude*, and optional\n*altitude*, and with optional bounding box *bbox*.","summary":"

Creates a new Point at the given longitude, latitude, and optional altitude, and with optional bounding box bbox.

","abstract":false,"args":[{"name":"longitude","external_name":"longitude","restriction":""},{"name":"latitude","external_name":"latitude","restriction":""},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(longitude, latitude, altitude = nil, bbox = nil)","args_html":"(longitude, latitude, altitude = nil, bbox = nil)","location":{"filename":"src/geojson/point.cr","line_number":15,"url":null},"def":{"name":"new","args":[{"name":"longitude","external_name":"longitude","restriction":""},{"name":"latitude","external_name":"latitude","restriction":""},{"name":"altitude","default_value":"nil","external_name":"altitude","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(longitude, latitude, altitude, bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `Point` is a `Geometry` representing a single `Position` in geographic\nspace.\n\nThis class corresponds to the [GeoJSON Point](https://tools.ietf.org/html/rfc7946#section-3.1.2).","summary":"

A Point is a Geometry representing a single Position in geographic space.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/point.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:GeoJSON::Coordinates,*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Point` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"GeoJSON::Coordinates"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : GeoJSON::Coordinates, *, bbox = nil)","args_html":"(coordinates : GeoJSON::Coordinates, *, bbox = nil)","location":{"filename":"src/geojson/point.cr","line_number":21,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"GeoJSON::Coordinates"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Float64),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Point` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Float64), *, bbox = nil)","args_html":"(coordinates : Array(Float64), *, bbox = nil)","location":{"filename":"src/geojson/point.cr","line_number":25,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Float64)"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

Returns true if this reference is the same as other.

","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif coordinates == other.coordinates\nelse\n return false\nend\ntrue\n"}},{"html_id":"altitude(*args,**options)-instance-method","name":"altitude","doc":"Gets this Point's altitude.\n\nTechnically, this positional value is meant to be the height in meters\nabove the WGS84 ellipsoid.","summary":"

Gets this Point's altitude.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/point.cr","line_number":43,"url":null},"def":{"name":"altitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.altitude(*args, **options)"}},{"html_id":"altitude(*args,**options,&)-instance-method","name":"altitude","doc":"Gets this Point's altitude.\n\nTechnically, this positional value is meant to be the height in meters\nabove the WGS84 ellipsoid.","summary":"

Gets this Point's altitude.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/point.cr","line_number":43,"url":null},"def":{"name":"altitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.altitude(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/point.cr","line_number":29,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\n[coordinates[0], coordinates[1], coordinates[0], coordinates[1]]\n"}},{"html_id":"coordinates:Coordinates-instance-method","name":"coordinates","doc":"Returns this Point's coordinates.","summary":"

Returns this Point's coordinates.

","abstract":false,"location":{"filename":"src/geojson/point.cr","line_number":11,"url":null},"def":{"name":"coordinates","return_type":"Coordinates","visibility":"Public","body":"@coordinates"}},{"html_id":"hash(hasher)-instance-method","name":"hash","doc":"See `Object#hash(hasher)`","summary":"

See Object#hash(hasher)

","abstract":false,"args":[{"name":"hasher","external_name":"hasher","restriction":""}],"args_string":"(hasher)","args_html":"(hasher)","def":{"name":"hash","args":[{"name":"hasher","external_name":"hasher","restriction":""}],"visibility":"Public","body":"hasher = coordinates.hash(hasher)\nhasher\n"}},{"html_id":"latitude(*args,**options)-instance-method","name":"latitude","doc":"Gets this Point's latitude in decimal degrees according to WGS84.","summary":"

Gets this Point's latitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/point.cr","line_number":38,"url":null},"def":{"name":"latitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.latitude(*args, **options)"}},{"html_id":"latitude(*args,**options,&)-instance-method","name":"latitude","doc":"Gets this Point's latitude in decimal degrees according to WGS84.","summary":"

Gets this Point's latitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/point.cr","line_number":38,"url":null},"def":{"name":"latitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.latitude(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"longitude(*args,**options)-instance-method","name":"longitude","doc":"Gets this Point's longitude in decimal degrees according to WGS84.","summary":"

Gets this Point's longitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/geojson/point.cr","line_number":36,"url":null},"def":{"name":"longitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"coordinates.longitude(*args, **options)"}},{"html_id":"longitude(*args,**options,&)-instance-method","name":"longitude","doc":"Gets this Point's longitude in decimal degrees according to WGS84.","summary":"

Gets this Point's longitude in decimal degrees according to WGS84.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/geojson/point.cr","line_number":36,"url":null},"def":{"name":"longitude","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"coordinates.longitude(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this Point's GeoJSON type (\"Point\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/point.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"geojson/GeoJSON/Polygon","path":"GeoJSON/Polygon.html","kind":"class","full_name":"GeoJSON::Polygon","name":"Polygon","abstract":false,"superclass":{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},"ancestors":[{"html_id":"geojson/GeoJSON/Object","kind":"class","full_name":"GeoJSON::Object","name":"Object"},{"html_id":"geojson/JSON/Serializable/Unmapped","kind":"module","full_name":"JSON::Serializable::Unmapped","name":"Unmapped"},{"html_id":"geojson/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"geojson/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"geojson/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/geojson/polygon.cr","line_number":6,"url":null}],"repository_name":"geojson","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"geojson/GeoJSON","kind":"module","full_name":"GeoJSON","name":"GeoJSON"},"doc":"A `Polygon` is a `Geometry` representing a closed geometric figure in\ngeographic space with optional holes within it.\n\nThis class corresponds to the [GeoJSON Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6).","summary":"

A Polygon is a Geometry representing a closed geometric figure in geographic space with optional holes within it.

","constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","doc":"A `Polygon` is a `Geometry` representing a closed geometric figure in\ngeographic space with optional holes within it.\n\nThis class corresponds to the [GeoJSON Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6).","summary":"

A Polygon is a Geometry representing a closed geometric figure in geographic space with optional holes within it.

","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/geojson/polygon.cr","line_number":6,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}},{"html_id":"new(coordinates:Array(Array(Coordinates)),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Polygon` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Coordinates))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Coordinates)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Coordinates)), *, bbox = nil)","location":{"filename":"src/geojson/polygon.cr","line_number":15,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Coordinates))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Point)),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Polygon` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Point))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Point)), *, bbox = nil)","args_html":"(coordinates : Array(Array(Point)), *, bbox = nil)","location":{"filename":"src/geojson/polygon.cr","line_number":20,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Point))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(coordinates:Array(Array(Array(Float64))),*,bbox=nil)-class-method","name":"new","doc":"Creates a new `Polygon` with the given *coordinates* and optional bounding\nbox *bbox*.","summary":"

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

","abstract":false,"args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"args_string":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","args_html":"(coordinates : Array(Array(Array(Float64))), *, bbox = nil)","location":{"filename":"src/geojson/polygon.cr","line_number":29,"url":null},"def":{"name":"new","args":[{"name":"coordinates","external_name":"coordinates","restriction":"Array(Array(Array(Float64)))"},{"name":"","external_name":"","restriction":""},{"name":"bbox","default_value":"nil","external_name":"bbox","restriction":""}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(coordinates, bbox: bbox)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"bbox-instance-method","name":"bbox","doc":"Calculates the bounding box for any GeoJSON object, including `FeatureCollection`.","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/polygon.cr","line_number":37,"url":null},"def":{"name":"bbox","visibility":"Public","body":"if @bbox\n return @bbox\nend\nresult = [Float64::INFINITY, Float64::INFINITY, -Float64::INFINITY, -Float64::INFINITY]\n@coordinates.each do |ring|\n ring.each do |coord|\n if result[0] > coord[0]\n result[0] = coord[0]\n end\n if result[1] > coord[1]\n result[1] = coord[1]\n end\n if result[2] < coord[0]\n result[2] = coord[0]\n end\n if result[3] < coord[1]\n result[3] = coord[1]\n end\n end\nend\nresult\n"}},{"html_id":"coordinates:Array(Array(Coordinates))-instance-method","name":"coordinates","doc":"Returns this Polygon's linear ring coordinates.","summary":"

Returns this Polygon's linear ring coordinates.

","abstract":false,"location":{"filename":"src/geojson/polygon.cr","line_number":11,"url":null},"def":{"name":"coordinates","return_type":"Array(Array(Coordinates))","visibility":"Public","body":"@coordinates"}},{"html_id":"type:String-instance-method","name":"type","doc":"Gets this Polygon's GeoJSON type (\"Polygon\")","summary":"

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

","abstract":false,"location":{"filename":"src/geojson/polygon.cr","line_number":8,"url":null},"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]}]}]}}) \ No newline at end of file