class GeoJSON::Coordinates::Position
- GeoJSON::Coordinates::Position
- GeoJSON::Coordinates::Coordinates(Float64)
- Reference
- Object
Overview
A Position
represents a position on earth with a longitude, latitude, and
optional altitude/elevation (#altivation
).
According to the GeoJSON spec, longitude and latitude are to be stored as decimal degrees, and altitude/elevation is to be stored as a height in meters.
Defined in:
geojson/coordinates/position.crConstructors
-
.new(coordinate_tree : CoordinateTree)
Creates a new
Position
from the given coordinate_tree. -
.new(coordinates : Array(T))
Creates new
Coordinates
backed by the given coordinates. -
.new(other : self)
Creates a new
Coordinates
that is a copy of the otherCoordinates
. -
.new(coordinates : Array)
Creates a new
Coordinates
from the given coordinates array. -
.new(parser : JSON::PullParser)
Creates new
Coordinates
using the given parser. -
.new(*, longitude lon, latitude lat, altivation alt = nil)
Creates a new
Position
with the given longitude, latitude, and altivation.
Instance Method Summary
-
#altivation
Returns the altivation (altitude or elevation) of this
Position
. -
#latitude
Returns the latitude of this
Position
. -
#longitude
Returns the longitude of this
Position
.
Instance methods inherited from class GeoJSON::Coordinates::Coordinates(Float64)
==(other : self)
==,
[](*args, **options)[](*args, **options, &) [], clone clone, coordinates : Array(T) coordinates, hash(hasher) hash, raise_if_invalid raise_if_invalid, to_json(*args, **options)
to_json(*args, **options, &) to_json
Constructor methods inherited from class GeoJSON::Coordinates::Coordinates(Float64)
new(coordinates : Array(T))new(other : self)
new(coordinates : Array)
new(parser : JSON::PullParser)
new(coordinate_tree : CoordinateTree) new
Constructor Detail
Creates a new Position
from the given coordinate_tree.
Creates a new Position
with the given longitude, latitude, and
altivation.
Instance Method Detail
Returns the altivation (altitude or elevation) of this Position
.
The third coordinate of this Position
is assumed to be the altivation.
Returns the latitude of this Position
.
The second coordinate of this Position
is assumed to be the latitude.