View Source SRTM.Source behaviour (SRTM v0.7.0)

Specifies the API for using a custom SRTM dataset source.

Summary

Callbacks

Downloads the HGT file for the given coordinates and stores it under the given client.cache_path.

Types

@type coordinates() :: {SRTM.latitude(), SRTM.longitude()}
@type opts() :: keyword()

Callbacks

Link to this callback

fetch(t, coordinates, opts)

View Source
@callback fetch(SRTM.Client.t(), coordinates(), opts()) ::
  {:ok, Path.t()} | {:error, SRTM.Error.t() | :out_of_bounds}

Downloads the HGT file for the given coordinates and stores it under the given client.cache_path.

If successful, returns an ok tuple with the path to the file. Otherwise returns an error tuple with an SRTM.Error.t() or :out_of_bounds.