geoelevations

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

View Source
const (
	//SRTM_BASE_URL = "http://dds.cr.usgs.gov/srtm"
	SRTM_BASE_URL = "http://srtm.kurviger.de"
	SRTM1_URL     = "/SRTM1/"
	SRTM3_URL     = "/SRTM3/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalFileSrtmStorage

type LocalFileSrtmStorage struct {
	// contains filtered or unexported fields
}

func NewLocalFileSrtmStorage

func NewLocalFileSrtmStorage(cacheDirectory string) (*LocalFileSrtmStorage, error)

func (LocalFileSrtmStorage) IsNotExists

func (ds LocalFileSrtmStorage) IsNotExists(err error) bool

func (LocalFileSrtmStorage) LoadFile

func (ds LocalFileSrtmStorage) LoadFile(fn string) ([]byte, error)

func (LocalFileSrtmStorage) SaveFile

func (ds LocalFileSrtmStorage) SaveFile(fn string, bytes []byte) error

type Srtm

type Srtm struct {
	// contains filtered or unexported fields
}

func NewSrtm

func NewSrtm(client *http.Client) (*Srtm, error)

func NewSrtmWithCustomCacheDir

func NewSrtmWithCustomCacheDir(client *http.Client, cacheDirectory string) (*Srtm, error)

func NewSrtmWithCustomStorage

func NewSrtmWithCustomStorage(client *http.Client, storage SrtmLocalStorage) (*Srtm, error)

func (*Srtm) GetElevation

func (self *Srtm) GetElevation(client *http.Client, latitude, longitude float64) (float64, error)

type SrtmData

type SrtmData struct {
	Srtm1BaseUrl string    `json:"srtm1_base_url"`
	Srtm1        []SrtmUrl `json:"srtm1"`
	Srtm3BaseUrl string    `json:"srtm3_base_url"`
	Srtm3        []SrtmUrl `json:"srtm2"`
}

Info (to be (se)serialized) about all the SRTM files and their URLs

func LoadSrtmData

func LoadSrtmData(client *http.Client) (*SrtmData, error)

func (*SrtmData) GetBestSrtmUrl

func (self *SrtmData) GetBestSrtmUrl(fileName string) (string, *SrtmUrl)

func (*SrtmData) GetSrtm1Url

func (self *SrtmData) GetSrtm1Url(fileName string) (string, *SrtmUrl)

func (*SrtmData) GetSrtm3Url

func (self *SrtmData) GetSrtm3Url(fileName string) (string, *SrtmUrl)

type SrtmFile

type SrtmFile struct {
	// contains filtered or unexported fields
}

Struct with contents and some utility methods of a single SRTM file

type SrtmLocalStorage

type SrtmLocalStorage interface {
	// LoadFile loads a file, if not available, then err!=nil and IsNotExists(err) must be true
	LoadFile(fn string) ([]byte, error)
	IsNotExists(err error) bool
	SaveFile(fn string, bytes []byte) error
}

type SrtmUrl

type SrtmUrl struct {
	// FileName without extension
	Name string `json:"n"`
	Url  string `json:"u"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL