class GeoJSON::Coordinates
- GeoJSON::Coordinates
- Reference
- Object
Overview
A Coordinates is a position in longitude, latitude, and (optionally)
altitude.
This class corresponds to the GeoJSON Position.
Defined in:
geojson/coordinates.crConstructors
-
.new(longitude : Float64, latitude : Float64, altitude : Float64 | Nil = nil)
Creates a new
Coordinateswith the given longitude, latitude and altitude. -
.new(coordinates : Array(Float64))
Creates a new
Coordinateswith the given coordinates array. -
.new(parser : JSON::PullParser)
Deserializes a
Coordinatesfrom the given JSON parser.
Instance Method Summary
-
#==(other : self)
Returns
trueif this reference is the same as other. - #[](*args, **options)
- #[](*args, **options, &)
-
#altitude
Gets this Coordinates' altitude.
- #coordinates : Array(Float64)
-
#hash(hasher)
See
Object#hash(hasher) -
#latitude
Gets this Coordinates' latitude in decimal degrees according to WGS84.
-
#longitude
Gets this Coordinates' longitude in decimal degrees according to WGS84.
- #to_json(*args, **options)
- #to_json(*args, **options, &)
Constructor Detail
Creates a new Coordinates with the given longitude, latitude and altitude.
Creates a new Coordinates with the given coordinates array.
Instance Method Detail
Returns true if this reference is the same as other. Invokes same?.
Gets this Coordinates' altitude.
Technically, this positional value is meant to be the height in meters above the WGS84 ellipsoid.