Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/points.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct LLA{T <: Number}
lon::T
alt::T
end
LLA(lat, lon, alt=zero(lat)) = LLA(promote(lat, lon, alt)...)
LLA(lat::Number, lon::Number, alt::Number=zero(lat)) = LLA(promote(lat, lon, alt)...)
LLA(;lat=NaN,lon=NaN,alt=0.0) = LLA(lat,lon,alt) # Constructor that is idependent of storage order

Base.show(io::IO, lla::LLA) = print(io, "LLA(lat=$(lla.lat)°, lon=$(lla.lon)°, alt=$(lla.alt))") # Maybe show to nearest mm, or 6 decimel places?
Expand Down
1 change: 1 addition & 0 deletions test/points.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@test LLA(lat = 1., lon = 1., alt = 0.) == lla
@test LLA(1//1, 1, 0.) == lla
@test LLA(1, 1) == LLA{Int}(1, 1, 0)
@test_throws MethodError LLA(missing, missing)

latlon = LatLon(1., 1.)
@test LatLon(lat = 1., lon = 1.) == latlon
Expand Down
Loading