Wednesday, November 5, 2014

srtm.py and srtm.go

I just released go-elevations, it is a golang parser for the Shuttle Radar Topography Mission elevation data (SRTM).

In simpler words, it is a library which can give you a elevation for every point on Earth. At least, if the SRTM dataset is accurate.

Usage:

package main

import (
    "fmt"

    "github.com/tkrajina/go-elevations/geoelevations"
)

func main() {
    srtm, err := geoelevations.NewSrtm()
    if err != nil {
        panic(err.Error())
    }
    elevation, err := srtm.GetElevation(45.2775, 13.726111)
    if err != nil {
        panic(err.Error())
    }
    fmt.Println("ViĆĄnjan elevation is", elevation)
}
It is based on my previous srtm.py (python). And there is also a Ruby port.

No comments:

Post a Comment