tilemerge

package module
v0.0.0-...-8df384c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2018 License: MIT Imports: 7 Imported by: 0

README

GoDoc Build Status Coverage Status Go Report Card

tilemerge

Merge 2D map tiles into a single image.

Requires Go 1.9+

Under heavy development!

Purpose

This library is intended to assist with merging individual map tiles into a single image.

A common use case is to create a static map image from an interactive Leaflet.

TODO:

  • Handle anti-meridian wrapping and several world-widths
  • Handle negative offets and width / height larger than tiles
  • Flag for test to update golden files
  • Test with transparency
  • Test with missing tiles
  • Test with paletted PNGs
  • Test with webp tiles
  • Documentation

Dependencies

Dependencies are managed using dep

Similar libraries

Documentation

Index

Constants

View Source
const TILE_SIZE = 256

TILE_SIZE uses default size of map tiles for now TODO: probably should be a parameter or detected from the input images

Variables

This section is empty.

Functions

func Merge

func Merge(tiles Tiles, xOff, yOff, width, height int, bg color.Color) (image.Image, error)

Merge merges input Tiles into a single Image with dimenensions `width` and `height`, and crops based on xOff, yOff from upper left of image. Tile x and y coordinates increase from the upper left of the image. Any tile that

Types

type Tile

type Tile struct {
	Z    uint8 // don't really need to know this here
	X, Y int
	Data *[]byte // nil if there is no valid image data for this tile coordinate
}

Tile is a container for basic information about a tile

type Tiles

type Tiles struct {
	Tiles          []Tile
	X0, Y0, X1, Y1 int
}

Tiles wraps Tile structs with information about the x and y tile index ranges

Jump to

Keyboard shortcuts

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