cmd

package
v0.0.0-...-81ca5f0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Copyright © 2022 Val Gridnev

Copyright © 2022 Val Gridnev

Index

Constants

View Source
const (
	CacheSize = 4 * 512
	TileSize  = 256

	MaxConcurrency = 8
)

Variables

View Source
var (
	ErrTileNotFound = fmt.Errorf("not found")
)

Functions

func ColorReliefImage

func ColorReliefImage(img image.Image, gm *gradientMap) (image.Image, error)

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func HillshadeImage

func HillshadeImage(img image.Image,
	pixel_res float64,
	h_factor float64,
	altitude float64,
	azimuth float64) (image.Image, error)

func MustParseHex

func MustParseHex(s string) colorful.Color

func NewGradientMap

func NewGradientMap(colorCard []colorCard, heighPrecision float64) (*gradientMap, error)

func NewTerra

func NewTerra(cfg aws.Config, s3Config s3Config) (*terra, error)

func TransparentGrayscale

func TransparentGrayscale(img image.Image) image.Image

Types

type CacheTileStore

type CacheTileStore struct {
	// contains filtered or unexported fields
}

func NewCacheTileStore

func NewCacheTileStore(tileNameTempl string, cacheSize int) (*CacheTileStore, error)

func (*CacheTileStore) Add

func (ts *CacheTileStore) Add(z uint32, x uint32, y uint32, data []byte)

func (*CacheTileStore) ClearTile

func (ts *CacheTileStore) ClearTile(ctx context.Context, z uint32, x uint32, y uint32)

func (*CacheTileStore) GetTile

func (ts *CacheTileStore) GetTile(ctx context.Context, z uint32, x uint32, y uint32) ([]byte, error)

type ElevationTileStore

type ElevationTileStore struct {
	// contains filtered or unexported fields
}

func NewElevationTileStore

func NewElevationTileStore(tileNameTempl string, cacheSize int) (*ElevationTileStore, error)

func (*ElevationTileStore) Add

func (ts *ElevationTileStore) Add(z uint32, x uint32, y uint32, data []float64)

func (*ElevationTileStore) GetTile

func (ts *ElevationTileStore) GetTile(ctx context.Context, z uint32, x uint32, y uint32) ([]float64, error)

type FeatureOutFormat

type FeatureOutFormat string
const (
	FeatureOutGeoJSON FeatureOutFormat = "geojson"
	FeatureOutMVT     FeatureOutFormat = "mvt"
)

type GradientTable

type GradientTable []HeightColor

type HeightColor

type HeightColor struct {
	Col    colorful.Color
	Height float64
}

type S3TileStore

type S3TileStore struct {
	// contains filtered or unexported fields
}

func NewS3TileStore

func NewS3TileStore(s3Client *s3.Client, bucketName string, tileNameTempl string) (*S3TileStore, error)

func (*S3TileStore) ClearTile

func (ts *S3TileStore) ClearTile(ctx context.Context, z uint32, x uint32, y uint32)

func (*S3TileStore) GetTile

func (ts *S3TileStore) GetTile(ctx context.Context, z uint32, x uint32, y uint32) ([]byte, error)

type TileStore

type TileStore interface {
	GetTile(ctx context.Context, z uint32, x uint32, y uint32) ([]byte, error)
	ClearTile(ctx context.Context, z uint32, x uint32, y uint32)
}

Jump to

Keyboard shortcuts

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