heightmap

package
v0.0.0-...-9557365 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elevation

type Elevation struct {
	Width     int
	Height    int
	MinHeight int16
	MaxHeight int16
	Points    []Point
}

Elevation Represents a heightmap in memory

type Generator

type Generator struct {
	ElevationDataset *hgt.DataDir
	SrtmDownloader   *srtm.Downloader
	Dir              string
}

Generator HeightmapGenerator Generate heightmaps based on a digital elevation model (DEM) dataset

func (Generator) CreateHeightMapImage

func (t Generator) CreateHeightMapImage(lat, lon float64, side int,
	conf ResolutionConfig) ([]byte, error)

func (Generator) GetPointsElevations

func (t Generator) GetPointsElevations(points []Point) []Point

func (Generator) GetTileHeightmap

func (t Generator) GetTileHeightmap(z, x, y, resolution int) ([]byte, error)

GetTileHeightmap Generate a heightmap with the same size of an OpenStreetMap (OSM) tile

type Point

type Point struct {
	X, Y      int
	Lat, Lon  float64
	Elevation int16
}

Point Elevation of a specific geographic point represented by latitude and longitude (WGS84) X and Y represents a point in the heightmap image

type ResolutionConfig

type ResolutionConfig struct {
	Width                            int
	Height                           int
	ForceInterpolation               bool
	IgnoreWhenOriginalImageIsSmaller bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳