This commit is contained in:
Anatoly Antonov 2026-05-18 03:17:17 +09:00
parent 7a8d5d13fa
commit 9e663db9dc
68 changed files with 5647 additions and 2958 deletions

View file

@ -71,9 +71,10 @@ func (d *Dataset) getCell(latIdx, lngIdx int) int16 {
return int16(binary.LittleEndian.Uint16(d.mm[off : off+2]))
}
// Get returns the interpolated elevation in metres at the given coordinates.
// lat: -90 to +90, lng: 0 to 360 (or -180 to 180, will be normalised).
func (d *Dataset) Get(lat, lng float64) float64 {
// Elevation returns the bilinearly-interpolated ground elevation in metres at
// the given coordinates. lat is in [-90, +90]; lng accepts either [0, 360) or
// [-180, 180) and is normalised internally.
func (d *Dataset) Elevation(lat, lng float64) float64 {
// Normalise longitude to [0, 360)
if lng < 0 {
lng += 360