Documentation
¶
Index ¶
- Constants
- func BboxRegion(bbox string) (orb.MultiPolygon, error)
- func Convert(logger *log.Logger, input string, output string, deduplicate bool, ...) error
- func ConvertMbtiles(logger *log.Logger, input string, output string, deduplicate bool, ...) error
- func ConvertPmtilesV2(logger *log.Logger, input string, output string, deduplicate bool, ...) error
- func Extract(logger *log.Logger, bucketURL string, key string, maxzoom int8, ...) error
- func IdToZxy(i uint64) (uint8, uint32, uint32)
- func MergeRanges(ranges []SrcDstRange, overfetch float32) (*list.List, uint64)
- func NormalizeBucketKey(bucket string, prefix string, key string) (string, string, error)
- func ParentId(i uint64) uint64
- func ParseEntryV2(b []byte) (uint8, Zxy, Range)
- func ReencodeEntries(dir []EntryV3) ([]EntryV3, []SrcDstRange, uint64, uint64, uint64)
- func RelevantEntries(bitmap *roaring64.Bitmap, maxzoom uint8, dir []EntryV3) ([]EntryV3, []EntryV3)
- func Show(logger *log.Logger, bucketURL string, key string, show_metadata_only bool, ...) error
- func UnmarshalRegion(data []byte) (orb.MultiPolygon, error)
- func Upload(logger *log.Logger, input string, bucket string, key string, ...) error
- func Verify(logger *log.Logger, file string) error
- func WriteImage(interior *roaring64.Bitmap, boundary *roaring64.Bitmap, ...)
- func ZxyToId(z uint8, x uint32, y uint32) uint64
- type Bucket
- type BucketAdapter
- type CacheKey
- type CachedValue
- type Compression
- type CopyDiscard
- type DirectoryV2
- type EntryV3
- type HeaderV3
- type HttpBucket
- type OffsetLen
- type OverfetchListItem
- type OverfetchRange
- type Range
- type Request
- type Resolver
- type Response
- type Server
- type SrcDstRange
- type TileType
- type Zxy
Constants ¶
const ( UnknownCompression Compression = 0 NoCompression = 1 Gzip = 2 Brotli = 3 Zstd = 4 )
const ( UnknownTileType TileType = 0 Mvt = 1 Png = 2 Jpeg = 3 Webp = 4 Avif = 5 )
const HEADERV3_LEN_BYTES = 127
Variables ¶
This section is empty.
Functions ¶
func BboxRegion ¶ added in v1.10.0
func BboxRegion(bbox string) (orb.MultiPolygon, error)
func ConvertMbtiles ¶ added in v1.1.0
func ConvertPmtilesV2 ¶ added in v1.1.0
func MergeRanges ¶ added in v1.9.0
func MergeRanges(ranges []SrcDstRange, overfetch float32) (*list.List, uint64)
MergeRanges takes a slice of SrcDstRanges, that: * is non-contiguous, and is sorted by NewOffset * an Overfetch parameter
- overfetch = 0.2 means we can request an extra 20%
- overfetch = 1.00 means we can double our total transfer size
Return a slice of OverfetchRanges
Each OverfetchRange is one or more input ranges input ranges are merged in order of smallest byte distance to next range until the overfetch budget is consumed. The slice is sorted by Length
func NormalizeBucketKey ¶ added in v1.9.1
func ReencodeEntries ¶ added in v1.9.0
Given a tile entries for a Source archive, sorted in TileID order, return: * Re-encoded tile-entries, with their offsets changed to contiguous (clustered) order in a new archive. * SrcDstRange: slice of offsets in the source archive, offset in the new archive, and length.
- Each range is one or more tiles
- the output must not have contiguous entries
- It is sorted by new offsets, but not necessarily by source offsets
* The total size of the tile section in the new archive * The # of addressed tiles (sum over RunLength) * # the number of unique offsets ("tile contents")
- this might not be the last SrcDstRange new_offset + length, it's the highest offset (can be in the middle)
func RelevantEntries ¶ added in v1.9.0
given a bitmap and a set of existing entries, create only relevant entries return sorted slice of entries, and slice of all leaf entries any runlengths > 1 will be "trimmed" to the relevance bitmap
func UnmarshalRegion ¶ added in v1.9.1
func UnmarshalRegion(data []byte) (orb.MultiPolygon, error)
func WriteImage ¶ added in v1.7.0
Types ¶
type Bucket ¶ added in v1.9.1
type BucketAdapter ¶ added in v1.9.1
func (BucketAdapter) Close ¶ added in v1.9.1
func (ba BucketAdapter) Close() error
func (BucketAdapter) NewRangeReader ¶ added in v1.9.1
func (ba BucketAdapter) NewRangeReader(ctx context.Context, key string, offset, length int64) (io.ReadCloser, error)
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 CopyDiscard ¶ added in v1.9.0
"want the next N bytes, then discard N bytes"
type DirectoryV2 ¶ added in v1.1.0
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 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 HttpBucket ¶ added in v1.9.1
type HttpBucket struct {
// contains filtered or unexported fields
}
func (HttpBucket) Close ¶ added in v1.9.1
func (b HttpBucket) Close() error
func (HttpBucket) NewRangeReader ¶ added in v1.9.1
func (b HttpBucket) NewRangeReader(ctx context.Context, key string, offset, length int64) (io.ReadCloser, error)
type OverfetchListItem ¶ added in v1.9.0
type OverfetchListItem struct {
Rng SrcDstRange
CopyDiscards []CopyDiscard
BytesToNext uint64 // the "priority"
// contains filtered or unexported fields
}
A single request, where only some of the bytes in the requested range we want
type OverfetchRange ¶ added in v1.9.0
type OverfetchRange struct {
Rng SrcDstRange
CopyDiscards []CopyDiscard
}
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 (*Resolver) AddTileIsNew ¶ added in v1.0.0
must be called in increasing tile_id order, uniquely
func (*Resolver) NumContents ¶ added in v1.6.0
type Server ¶ added in v1.7.0
type Server struct {
// contains filtered or unexported fields
}