class

GeoJSON::Coordinates

Inherits Reference < Object

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

This class corresponds to the GeoJSON Position.

Constructors

new(longitude : Float64, latitude : Float64, altitude : Float64 | Nil = nil)

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

Source
new(coordinates : Array(Float64))

Creates a new Coordinates with the given coordinates array.

Source
new(parser : JSON::PullParser)

Deserializes a Coordinates from the given JSON parser.

Source

Instance methods

==(other : self)

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

[](*args, **options)
Source
[](*args, **options, &)
Source
altitude

Gets this Coordinates' altitude.

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

Source
coordinates
Source
hash(hasher)

See Object#hash(hasher)

latitude

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

Source
longitude

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

Source
to_json(*args, **options)
Source
to_json(*args, **options, &)
Source