pmtiles

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: BSD-3-Clause Imports: 27 Imported by: 12

Documentation

Index

Constants

View Source
const (
	UnknownCompression Compression = 0
	NoCompression                  = 1
	Gzip                           = 2
	Brotli                         = 3
	Zstd                           = 4
)
View Source
const (
	UnknownTileType TileType = 0
	Mvt                      = 1
	Png                      = 2
	Jpeg                     = 3
	Webp                     = 4
)
View Source
const HEADERV3_LEN_BYTES = 127

Variables

This section is empty.

Functions

func Convert added in v1.0.0

func Convert(logger *log.Logger, input string, output string, deduplicate bool) error

func ConvertMbtiles added in v1.1.0

func ConvertMbtiles(logger *log.Logger, input string, output string, deduplicate bool) error

func ConvertPmtilesV2 added in v1.1.0

func ConvertPmtilesV2(logger *log.Logger, input string, output string, deduplicate bool) error

func IdToZxy added in v1.0.0

func IdToZxy(i uint64) (uint8, uint32, uint32)

func Matches

func Matches(z uint8, minX uint32, minY uint32, maxX uint32, maxY uint32, candidate Zxy) bool

func ParseEntryV2 added in v1.1.0

func ParseEntryV2(b []byte) (uint8, Zxy, Range)

func Show added in v1.1.0

func Show(logger *log.Logger, args []string) error

func SubpyramidXY

func SubpyramidXY(logger *log.Logger, input string, output string, z uint8, minX uint32, minY uint32, maxX uint32, maxY uint32, bounds string)

func Upload added in v1.1.0

func Upload(logger *log.Logger, args []string) error

func ZxyToId added in v1.0.0

func ZxyToId(z uint8, x uint32, y uint32) uint64

Types

type CacheKey added in v1.2.0

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

type CachedValue added in v1.2.0

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

type Compression added in v1.0.0

type Compression uint8

type DirectoryV2 added in v1.1.0

type DirectoryV2 struct {
	Entries map[Zxy]Range
	LeafZ   uint8
	Leaves  map[Zxy]Range
}

func ParseDirectoryV2 added in v1.1.0

func ParseDirectoryV2(dir_bytes []byte) DirectoryV2

func ParseHeaderV2 added in v1.1.0

func ParseHeaderV2(reader io.Reader) ([]byte, DirectoryV2)

func (DirectoryV2) SizeBytes added in v1.1.0

func (d DirectoryV2) SizeBytes() int

type EntryV3 added in v1.0.0

type EntryV3 struct {
	TileId    uint64
	Offset    uint64
	Length    uint32
	RunLength uint32
}

type HeaderV3 added in v1.0.0

type HeaderV3 struct {
	SpecVersion         uint8
	RootOffset          uint64
	RootLength          uint64
	MetadataOffset      uint64
	MetadataLength      uint64
	LeafDirectoryOffset uint64
	LeafDirectoryLength uint64
	TileDataOffset      uint64
	TileDataLength      uint64
	AddressedTilesCount uint64
	TileEntriesCount    uint64
	TileContentsCount   uint64
	Clustered           bool
	InternalCompression Compression
	TileCompression     Compression
	TileType            TileType
	MinZoom             uint8
	MaxZoom             uint8
	MinLonE7            int32
	MinLatE7            int32
	MaxLonE7            int32
	MaxLatE7            int32
	CenterZoom          uint8
	CenterLonE7         int32
	CenterLatE7         int32
}

type Loop

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

func NewLoop

func NewLoop(path string, logger *log.Logger, cacheSize int, cors string) (*Loop, error)

func (*Loop) Get

func (loop *Loop) Get(ctx context.Context, path string) (int, map[string]string, []byte)

func (*Loop) Start

func (loop *Loop) Start()

type Metadata

type Metadata struct {
	Format      string `json:"format"`
	Minzoom     string `json:"minzoom"`
	Maxzoom     string `json:"maxzoom"`
	Bounds      string `json:"bounds"`
	Compress    string `json:"compress"`
	Attribution string `json:"attribution"`
}

type OffsetLen added in v1.0.0

type OffsetLen struct {
	Offset uint64
	Length uint32
}

type Range

type Range struct {
	Offset uint64
	Length uint32
}

type Request

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

type Resolver added in v1.0.0

type Resolver struct {
	Entries        []EntryV3
	Offset         uint64
	OffsetMap      map[string]OffsetLen
	AddressedTiles uint64 // none of them can be empty
	// contains filtered or unexported fields
}

func NewResolver added in v1.0.0

func NewResolver(deduplicate bool, compress bool) *Resolver

func (*Resolver) AddTileIsNew added in v1.0.0

func (r *Resolver) AddTileIsNew(tile_id uint64, data []byte) (bool, []byte)

must be called in increasing tile_id order, uniquely

func (*Resolver) NumContents added in v1.6.0

func (r *Resolver) NumContents() uint64

type Response

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

type TileType added in v1.0.0

type TileType uint8

type Zxy

type Zxy struct {
	Z uint8
	X uint32
	Y uint32
}

func GetParentTile

func GetParentTile(tile Zxy, level uint8) Zxy

func PointToTile

func PointToTile(z int, lng float64, lat float64) Zxy

Jump to

Keyboard shortcuts

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