Documentation
¶
Overview ¶
Package mlt reads and writes MapLibre Tiles (https://github.com/maplibre/maplibre-tile-spec). Only the stable v1 layer format is supported
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMalformed = errors.New("malformed MLT tile")
Wrapped by every error caused by a tile that doesn't follow the specification
View Source
var ErrUnsupported = errors.New("unsupported MLT content")
Wrapped by errors for valid tile content this package can't process
Functions ¶
Types ¶
type Column ¶
type Column struct {
Type ColumnType
Name string
Nullable bool // Some features may lack a value
Present []bool // Only set when Nullable
// Per feature slice of the Go type matching Type. Zero where absent, nil for SharedDict
Values any
// ColumnSharedDict only. Columns sharing one dictionary, named by appending their Name to the parent's
Children []Column
}
type ColumnType ¶
type ColumnType uint8
Without the nullable flag
const ( ColumnBool ColumnType = 10 ColumnInt32 ColumnType = 16 ColumnUint32 ColumnType = 18 ColumnInt64 ColumnType = 20 ColumnUint64 ColumnType = 22 ColumnFloat ColumnType = 24 ColumnDouble ColumnType = 26 ColumnString ColumnType = 28 )
type Layer ¶
type Layer struct {
Name string
Extent uint32
ID *IDColumn // Nil if the layer has no id column
Geometries []orb.Geometry // In tile coordinates. Polygon rings are closed
Columns []Column
}
Every per-feature slice is indexed by feature
func Decode ¶
Parses every v1 layer. Other formats or layers past maxTileBytes are skipped and counted. Features past maxFeatureBytes are dropped
func (Layer) Clip ¶
Trims every geometry to a bound in tile coordinates, dropping features left empty
func (Layer) FeatureCount ¶
Click to show internal directories.
Click to hide internal directories.