SRTM.Client (SRTM v0.5.2) View Source

This module holds the client for querying elevation data.

Link to this section Summary

Functions

Creates a client struct that holds configuration and parsed HGT files.

Removes parsed HGT files from the in-memory cache.

Link to this section Types

Link to this section Functions

Specs

new(path :: Path.t(), opts :: list()) ::
  {:ok, t()} | {:error, error :: SRTM.Error.t()}

Creates a client struct that holds configuration and parsed HGT files.

If the directory at the given path doesn't exist, creates it.

Options

The supported options are:

  • :sources - the SRTM source providers (defaults to AWS, ESA and USGS)

Examples

iex> {:ok, client} = SRTM.Client.new("./cache")
{:ok, %SRTM.Client{}}
Link to this function

purge_in_memory_cache(client, opts \\ [])

View Source

Specs

purge_in_memory_cache(client :: t(), opts :: list()) :: {:ok, t()}

Removes parsed HGT files from the in-memory cache.

Options

The supported options are:

  • :keep - the number of most recently used HGT files to keep (default: 0)

Examples

iex> {:ok, client} = SRTM.Client.purge_in_memory_cache(client, keep: 1)
{:ok, %SRTM.Client{}}