tilepack

package
v1.0.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 26 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTileRanges

func GenerateTileRanges(opts *GenerateRangesOptions)

func GenerateTiles

func GenerateTiles(opts *GenerateTilesOptions)

func NewDiskOutputter

func NewDiskOutputter(dsnStr string) (*diskOutputter, error)

func NewMbtilesOutputter

func NewMbtilesOutputter(dsn string, batchSize int, metadata *MbtilesMetadata) (*mbtilesOutputter, error)

Types

type GenerateBoxesConsumerFunc

type GenerateBoxesConsumerFunc func(ll maptile.Tile, ur maptile.Tile, z maptile.Zoom)

type GenerateRangesOptions

type GenerateRangesOptions struct {
	Bounds       orb.Bound
	Zooms        []maptile.Zoom
	ConsumerFunc GenerateBoxesConsumerFunc
}

type GenerateTilesConsumerFunc

type GenerateTilesConsumerFunc func(tile maptile.Tile)

type GenerateTilesOptions

type GenerateTilesOptions struct {
	Bounds       orb.Bound
	Zooms        []maptile.Zoom
	ConsumerFunc GenerateTilesConsumerFunc
	InvertedY    bool
}

type HTTPError

type HTTPError struct {
	Code   int
	Status string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

func (*HTTPError) String

func (e *HTTPError) String() string

type JobGenerator

type JobGenerator interface {
	CreateWorker() (func(id int, jobs chan *TileRequest, results chan *TileResponse), error)
	CreateJobs(jobs chan *TileRequest) error
}

func NewFileTransportXYZJobGenerator

func NewFileTransportXYZJobGenerator(root string, urlTemplate string, bounds orb.Bound, zooms []maptile.Zoom, httpTimeout time.Duration, invertedY bool, ensureGzip bool) (JobGenerator, error)

func NewMetatileJobGenerator

func NewMetatileJobGenerator(bucket string, requesterPays bool, pathTemplate string, layerName string, format string, metatileSize uint, maxDetailZoom maptile.Zoom, zooms []maptile.Zoom, bounds orb.Bound) (JobGenerator, error)

func NewTapalcatl2JobGenerator

func NewTapalcatl2JobGenerator(bucket string, requesterPays bool, pathTemplate string, layerName string, materializedZooms []maptile.Zoom, zooms []maptile.Zoom, bounds orb.Bound) (JobGenerator, error)

func NewXYZJobGenerator

func NewXYZJobGenerator(urlTemplate string, bounds orb.Bound, zooms []maptile.Zoom, httpTimeout time.Duration, invertedY bool, ensureGzip bool) (JobGenerator, error)

type MbtilesMetadata

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

func NewMbtilesMetadata

func NewMbtilesMetadata(metadata map[string]string) *MbtilesMetadata

func (*MbtilesMetadata) Bounds

func (m *MbtilesMetadata) Bounds() (orb.Bound, error)

func (*MbtilesMetadata) Center

func (m *MbtilesMetadata) Center() (orb.Point, error)

func (*MbtilesMetadata) Format

func (m *MbtilesMetadata) Format() (string, error)

func (*MbtilesMetadata) Get

func (m *MbtilesMetadata) Get(k string) (string, bool)

func (*MbtilesMetadata) Keys

func (m *MbtilesMetadata) Keys() []string

func (*MbtilesMetadata) MaxZoom

func (m *MbtilesMetadata) MaxZoom() (uint, error)

func (*MbtilesMetadata) MinZoom

func (m *MbtilesMetadata) MinZoom() (uint, error)

func (*MbtilesMetadata) Name

func (m *MbtilesMetadata) Name() (string, error)

func (*MbtilesMetadata) Set

func (m *MbtilesMetadata) Set(key string, value string)

type MbtilesReader

type MbtilesReader interface {
	Close() error
	GetTile(tile maptile.Tile) (*TileData, error)
	VisitAllTiles(visitor func(maptile.Tile, []byte)) error
	Metadata() (*MbtilesMetadata, error)
}

func NewMbtilesReader

func NewMbtilesReader(dsn string) (MbtilesReader, error)

func NewMbtilesReaderWithDatabase

func NewMbtilesReaderWithDatabase(db *sql.DB) (MbtilesReader, error)

type TileData

type TileData struct {
	Tile maptile.Tile
	Data *[]byte
}

type TileOutputter

type TileOutputter interface {
	CreateTiles() error
	Save(tile maptile.Tile, data []byte) error
	AssignSpatialMetadata(orb.Bound, maptile.Zoom, maptile.Zoom) error
	Close() error
}

type TileRequest

type TileRequest struct {
	Tile maptile.Tile
	URL  string
}

type TileResponse

type TileResponse struct {
	Tile    maptile.Tile
	Data    []byte
	Elapsed float64
}

Jump to

Keyboard shortcuts

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