maptiles

package
v0.0.0-...-addbd46 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2015 License: BSD-3-Clause Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTileRendererChan

func NewTileRendererChan(stylesheet string) chan<- TileFetchRequest

Types

type Generator

type Generator struct {
	MapFile string
	TileDir string
	Threads int
}

func (*Generator) Run

func (g *Generator) Run(lowLeft, upRight mapnik.Coord, minZ, maxZ uint64, name string)

Generates tile files as a <zoom>/<x>/<y>.png file hierarchy in the current work directory.

type LayerMultiplex

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

func DefaultRenderMultiplex

func DefaultRenderMultiplex(defaultStylesheet string) *LayerMultiplex

func NewLayerMultiplex

func NewLayerMultiplex() *LayerMultiplex

func (*LayerMultiplex) AddRenderer

func (l *LayerMultiplex) AddRenderer(name string, stylesheet string)

func (*LayerMultiplex) AddSource

func (l *LayerMultiplex) AddSource(name string, fetchChan chan<- TileFetchRequest)

func (LayerMultiplex) SubmitRequest

func (l LayerMultiplex) SubmitRequest(r TileFetchRequest) bool

type TileCoord

type TileCoord struct {
	X, Y, Zoom uint64
	Tms        bool
	Layer      string
}

func (TileCoord) OSMFilename

func (c TileCoord) OSMFilename() string

type TileDb

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

MBTiles 1.2-compatible Tile Db with multi-layer support. Was named Mbtiles before, hence the use of *m in methods.

func NewTileDb

func NewTileDb(path string) *TileDb

func (*TileDb) Close

func (m *TileDb) Close()

func (TileDb) InsertQueue

func (m TileDb) InsertQueue() chan<- TileFetchResult

func (TileDb) RequestQueue

func (m TileDb) RequestQueue() chan<- TileFetchRequest

func (*TileDb) Run

func (m *TileDb) Run()

Best executed in a dedicated go routine.

type TileFetchRequest

type TileFetchRequest struct {
	Coord   TileCoord
	OutChan chan<- TileFetchResult
}

type TileFetchResult

type TileFetchResult struct {
	Coord   TileCoord
	BlobPNG []byte
}

type TileRenderer

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

Renders images as Web Mercator tiles

func NewTileRenderer

func NewTileRenderer(stylesheet string) *TileRenderer

func (*TileRenderer) RenderTile

func (t *TileRenderer) RenderTile(c TileCoord) ([]byte, error)

func (*TileRenderer) RenderTileZXY

func (t *TileRenderer) RenderTileZXY(zoom, x, y uint64) ([]byte, error)

Render a tile with coordinates in Google tile format. Most upper left tile is always 0,0. Method is not thread-safe, so wrap with a mutex when accessing the same renderer by multiple threads or setup multiple goroutinesand communicate with channels, see NewTileRendererChan.

type TileServer

type TileServer struct {
	TmsSchema bool
	// contains filtered or unexported fields
}

Handles HTTP requests for map tiles, caching any produced tiles in an MBtiles 1.2 compatible sqlite db.

func NewTileServer

func NewTileServer(cacheFile string) *TileServer

func (*TileServer) AddMapnikLayer

func (t *TileServer) AddMapnikLayer(layerName string, stylesheet string)

func (*TileServer) ServeHTTP

func (t *TileServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*TileServer) ServeTileRequest

func (t *TileServer) ServeTileRequest(w http.ResponseWriter, r *http.Request, tc TileCoord)

Jump to

Keyboard shortcuts

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