hmapgen

package module
v0.0.0-...-7555213 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2017 License: MIT Imports: 14 Imported by: 0

README

Go Report Card

HMAPGEN

A simple library in Go to generate heightmap images of a given location.

Prerequisite

In order to generate the heightmap, you must have at least an Api key for the following services:

USAGE

import (
  "github.com/michaelvial/hmapgen"
)

// South, West, North and East Lat/Lng coordinates 
area := ["45.142724","6.0888359","45.7316515","7.1368806"]

// Available options
options := hmapgen.Options{
    Service: "bing",  // Either bing or ign
    Key: "xxx",  // The API key for the elevation service
    Precision: 1000,  // Interval between each points (in meter)
    File: "./images/output.png", // Heightmap filename
}

// Heightmap generation
hmapinfo, err := hmapgen.GenerateHeightMap(area, options)

// Filename
fmt.Printf("Output file:", hmapinfo.Filename)
// Diff between the lowest point and the highest point (in meter)
fmt.Printf("Height offset:", hmapinfo.HeightOffset)

Licenses

All source code is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// The elevation service used (ign|bing)
	Service string
	// The API key for the elevation service
	Key string
	// Distance in meter between grid points
	Precision float64
	// Image file name
	File string
}

An Options structure is used for generating the heighmap

type Response

type Response struct {
	// Filename of the heightmap
	Filename string
	// Height offset bewenn the lowest point and the highest point (in meter)
	HeightOffset int
}

Response struct is returned for a successful GenerateHeightMap call

func GenerateHeightMap

func GenerateHeightMap(area []string, options Options) (Response, error)

GenerateHeightMap generates a heightmap image of a given area location.

Jump to

Keyboard shortcuts

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