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, &) #