Documentation ¶
Index ¶
- func NewTileRendererChan(stylesheet string) chan<- FetchRequest
- type FetchRequest
- type Generator
- type LayerMultiplex
- type MetaTileCoord
- type MetaTileFetchRequest
- type SubImager
- type TileCoord
- type TileDb
- type TileFetchRequest
- type TileFetchResult
- type TileRenderer
- func (t *TileRenderer) Listen(c <-chan FetchRequest)
- func (t *TileRenderer) ProcessRequest(request FetchRequest)
- func (t *TileRenderer) RenderMetaTile(c MetaTileCoord) ([]TileFetchResult, error)
- func (t *TileRenderer) RenderTile(c TileCoord) ([]byte, error)
- func (t *TileRenderer) RenderTileZXY(zoom, x, y uint64) ([]byte, error)
- type TileServer
- type TileServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTileRendererChan ¶
func NewTileRendererChan(stylesheet string) chan<- FetchRequest
Types ¶
type FetchRequest ¶
type FetchRequest interface { IsMetaTile() bool GetCoord() TileCoord GetLayer() string GetMetaCoord() MetaTileCoord GetOutChan() chan<- TileFetchResult }
type LayerMultiplex ¶
type LayerMultiplex struct {
// contains filtered or unexported fields
}
func DefaultRenderMultiplex ¶
func DefaultRenderMultiplex(defaultStylesheet string, numRenderers int) *LayerMultiplex
func NewLayerMultiplex ¶
func NewLayerMultiplex(numRenderers int) *LayerMultiplex
func (*LayerMultiplex) AddRenderer ¶
func (l *LayerMultiplex) AddRenderer(name string, stylesheet string)
func (*LayerMultiplex) AddSource ¶
func (l *LayerMultiplex) AddSource(name string, fetchChan chan<- FetchRequest)
func (*LayerMultiplex) CreateRenderer ¶
func (l *LayerMultiplex) CreateRenderer(stylesheet string) chan<- FetchRequest
func (LayerMultiplex) SubmitRequest ¶
func (l LayerMultiplex) SubmitRequest(r FetchRequest) bool
type MetaTileCoord ¶
func (*MetaTileCoord) Count ¶
func (c *MetaTileCoord) Count() uint64
func (*MetaTileCoord) TileCoords ¶
func (c *MetaTileCoord) TileCoords() []TileCoord
func (*MetaTileCoord) XSize ¶
func (c *MetaTileCoord) XSize() uint64
func (*MetaTileCoord) YSize ¶
func (c *MetaTileCoord) YSize() uint64
type MetaTileFetchRequest ¶
type MetaTileFetchRequest struct { Coord MetaTileCoord // Will output multiple results OutChan chan<- TileFetchResult }
func (MetaTileFetchRequest) GetCoord ¶
func (r MetaTileFetchRequest) GetCoord() TileCoord
func (MetaTileFetchRequest) GetLayer ¶
func (r MetaTileFetchRequest) GetLayer() string
func (MetaTileFetchRequest) GetMetaCoord ¶
func (r MetaTileFetchRequest) GetMetaCoord() MetaTileCoord
func (MetaTileFetchRequest) GetOutChan ¶
func (r MetaTileFetchRequest) GetOutChan() chan<- TileFetchResult
func (MetaTileFetchRequest) IsMetaTile ¶
func (r MetaTileFetchRequest) IsMetaTile() bool
type TileCoord ¶
func (TileCoord) OSMFilename ¶
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 (*TileDb) BatchCheck ¶
BatchCheck checks whether the provided coordinates have tiles in the database.
func (*TileDb) BatchInsert ¶
func (m *TileDb) BatchInsert(inserts []TileFetchResult)
maximum length of inserts is 199 due to SQLITE_MAX_VARIABLE_NUMBER being 999
func (*TileDb) InsertQueue ¶
func (m *TileDb) InsertQueue() chan<- TileFetchResult
func (*TileDb) RequestQueue ¶
func (m *TileDb) RequestQueue() chan<- TileFetchRequest
type TileFetchRequest ¶
type TileFetchRequest struct { Coord TileCoord OutChan chan<- TileFetchResult }
func (TileFetchRequest) GetCoord ¶
func (r TileFetchRequest) GetCoord() TileCoord
func (TileFetchRequest) GetLayer ¶
func (r TileFetchRequest) GetLayer() string
func (TileFetchRequest) GetMetaCoord ¶
func (r TileFetchRequest) GetMetaCoord() MetaTileCoord
func (TileFetchRequest) GetOutChan ¶
func (r TileFetchRequest) GetOutChan() chan<- TileFetchResult
func (TileFetchRequest) IsMetaTile ¶
func (r TileFetchRequest) IsMetaTile() bool
type TileFetchResult ¶
type TileRenderer ¶
type TileRenderer struct {
// contains filtered or unexported fields
}
TileRenderer renders images as Web Mercator tiles
func NewTileRenderer ¶
func NewTileRenderer(stylesheet string) *TileRenderer
func (*TileRenderer) Listen ¶
func (t *TileRenderer) Listen(c <-chan FetchRequest)
Listen starts listening for TileFetchRequests on c. If the channel is closed, it stops.
func (*TileRenderer) ProcessRequest ¶
func (t *TileRenderer) ProcessRequest(request FetchRequest)
func (*TileRenderer) RenderMetaTile ¶
func (t *TileRenderer) RenderMetaTile(c MetaTileCoord) ([]TileFetchResult, error)
RenderMetaTile renders multiple tiles as a single tile, then slices them up.
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(cfg TileServerConfig) *TileServer
NewTileServer creates a new tile server
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)
type TileServerConfig ¶
type TileServerConfig struct { // CacheFile is the mbtiles file to use for caching. // An empty string disables caching. CacheFile string // NumRenderers specified the number of renderers to start for each layer. // If zero, runtime.GOMAXPROCS will be used. NumRenderers int }
TileServerConfig