Home

Awesome

Nim-Open-Elevation

Install

Use

import asyncdispatch, json, openelevation

let sample_query = %*{
  "locations":
  [
    {
      "latitude": 10.55,
      "longitude": 10.75
    },
    {
      "latitude": 20.42,
      "longitude": 20.5
    },
    {
      "latitude": 41.161758,
      "longitude": -8.583933
    }
  ]
}  # Example query taken from the Documentation.

## Sync client.
let client = OpenElevation(timeout: 99.byte)
echo client.lookup(42.0, 50.0)              # GET  (1 query max)
echo client.lookup(locations=sample_query)  # POST (multiple queries)

## Async client.
proc async_oe() {.async.} =
  let
    async_client = AsyncOpenElevation(timeout: 99.byte)
    async_response = await async_client.lookup(42.0, 50.0)
  echo async_response.pretty

wait_for async_oe()

# Check the Docs for more API Calls...

Command Line App

1 Query:

./open_elevation --color --lower --timeout=9 --lat=42.5 --lon=55.75

Multiple Queries:

./open_elevation --color --lower --timeout=9 '{"locations":[{"latitude":9,"longitude":10},{"latitude":41.68,"longitude":-8.58}]}'

API

FAQ

<details> <summary>Click to see FAQ</summary>

La aplicacion de linea de comandos soporta Espanol.

No.

Yes.

Yes.

Yes.

No.

No.

Yes. You MUST give Credit to OpenStreetMap Contributors!.

--ugly

--lower

--timeout=99

--lat=15.42 --lon=12.75

--color

--help

</details>

Requisites