Skip to main content

mlt_py

Python bindings for the MapLibre Tile (MLT) format via PyO3.

Decoding

import maplibre_tiles

data = open("tile.mlt", "rb").read()

# Structured decode with geo-referencing
layers = maplibre_tiles.decode_mlt(data, z=14, x=8297, y=10749, tms=True)
for layer in layers:
    print(f"Layer: {layer.name}, extent: {layer.extent}")
    for feat in layer.features[:3]:
        print(f"  id={feat.id}, type={feat.geometry_type}")
        print(f"  wkb={len(feat.wkb)} bytes, props={dict(feat.properties)}")

# Raw tile-local coordinates (no z/x/y needed)
layers = maplibre_tiles.decode_mlt(data)

# GeoJSON string output (tile-local coords)
geojson_str = maplibre_tiles.decode_mlt_to_geojson(data)

# Fast layer listing (no full decode)
names = maplibre_tiles.list_layers(data)

Decoded objects

decode_mlt(...) returns a list of MltLayer objects. Each MltLayer represents one decoded MLT layer and exposes:

  • name: str - the layer name.
  • extent: int - the layer extent.
  • z_step: int | None - the power of ten of the z grid's step in metres, or None when the vertices carry no z.
  • height_mode: str | None - what a z of 0 stands for, "absolute" (mean sea level) or "relative_to_ground" (the terrain), or None when the vertices carry no z.
  • features: list[MltFeature] - the decoded features in that layer.

Each MltFeature represents one decoded feature and exposes:

  • id: int | None - the feature id, if present.
  • geometry_type: str - the decoded geometry type.
  • wkb: bytes - the geometry as WKB. A layer with z writes ISO WKB Z, with grid values in tile coordinates and elevations in metres once z/x/y project.
  • properties: dict - the feature properties.
import maplibre_tiles


layers = maplibre_tiles.decode_mlt(data)
for layer in layers:
    print(layer.name, layer.extent)
    for feature in layer.features[:2]:
        print(feature.id, feature.geometry_type, dict(feature.properties))

Encoding

encode_geojson(geojson, name, extent=4096, *, tessellate=False, sort="auto", shared_dict=True, fsst=True, fastpfor=True, z_step=None, height_mode=None) -> bytes encodes a single layer to an MLT blob.

  • geojson is a GeoJSON FeatureCollection. Geometry is in tile-local coordinate space (no projection), matching tilezen/mapbox-vector-tile's default. Coordinates must be integers, and 2D unless z_step is set. They must be JSON integers (2048), not floats: a float-typed value such as 2048.0 raises ValueError.
  • name and extent set the MLT layer metadata, since a FeatureCollection has no slot for them. extent defaults to 4096.
  • tessellate generates triangulation data for polygons and multi-polygons.
  • sort controls which feature ordering(s) the encoder tries: all, auto, morton, hilbert, id, or none.
  • shared_dict enables grouping strings into shared dictionaries.
  • fsst enables FSST string compression.
  • fastpfor enables FastPFOR integer compression.
  • z_step is the power of ten of the z grid's step in metres, from -3 (1 mm) to 4 (10 km). Every position is then [x, y, z], and the layer is written in the experimental v2 format.
  • height_mode is what a z of 0 stands for: "absolute" (mean sea level, the default) or "relative_to_ground" (the terrain under each vertex). It needs z_step.

encode_mvt(data, *, tessellate=False, sort="auto", shared_dict=True, fsst=True, fastpfor=True) -> bytes encodes an entire raw Mapbox Vector Tile (protobuf) to MLT using the same encoding options.

import maplibre_tiles


blob = maplibre_tiles.encode_geojson(
    {
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "id": 1,
                "geometry": {"type": "Point", "coordinates": },
                "properties": {"name": "main", "lanes": 3},
            },
        ],
    },
    name="roads",
    extent=4096,
)


# Multi-layer tiles -> encode each layer and concatenate the bytes
tile = b"".join([
    maplibre_tiles.encode_geojson(roads, name="roads"),
    maplibre_tiles.encode_geojson(water, name="water"),
])
import maplibre_tiles


mvt = open("tile.mvt", "rb").read()

blob = maplibre_tiles.encode_mvt(mvt)


# With explicit encoding options
blob = maplibre_tiles.encode_mvt(
    mvt,
    tessellate=False,
    sort="auto",
    shared_dict=True,
    fsst=True,
    fastpfor=True,
)

Input is validated strictly. A non-FeatureCollection input, a non-Feature member, float-typed or 3D coordinates, null or empty geometry, nested or non-scalar property values, a non-u64 id, and an empty collection all raise ValueError.

Metadata

Release files for maplibre-tiles 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maplibre-tiles 0.4.4
File Size Uploaded Provenance Actions
maplibre_tiles-0.4.4.tar.gz 554.7 kB With provenance Details for maplibre_tiles-0.4.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for maplibre-tiles 0.4.4
File Actions
maplibre_tiles-0.4.4-cp315-cp315t-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.4-cp315-cp315t-macosx_11_0_arm64.whl
maplibre_tiles-0.4.4-cp315-cp315-manylinux_2_31_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.31+ x86-64 Details for maplibre_tiles-0.4.4-cp315-cp315-manylinux_2_31_x86_64.whl
maplibre_tiles-0.4.4-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.4-cp315-cp315-macosx_11_0_arm64.whl
maplibre_tiles-0.4.4-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.4-cp314-cp314-macosx_11_0_arm64.whl
maplibre_tiles-0.4.4-cp314-cp314-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.12+ x86-64 Details for maplibre_tiles-0.4.4-cp314-cp314-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.4-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.4-cp313-cp313-macosx_11_0_arm64.whl
maplibre_tiles-0.4.4-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details for maplibre_tiles-0.4.4-cp313-cp313-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.4-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.4-cp312-cp312-macosx_11_0_arm64.whl
maplibre_tiles-0.4.4-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for maplibre_tiles-0.4.4-cp312-cp312-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.4-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.4-cp311-cp311-macosx_11_0_arm64.whl
maplibre_tiles-0.4.4-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details for maplibre_tiles-0.4.4-cp311-cp311-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.4-cp310-cp310-manylinux_2_31_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.31+ x86-64 Details for maplibre_tiles-0.4.4-cp310-cp310-manylinux_2_31_x86_64.whl

Total release size: 26.8 MB

Release files / maplibre_tiles-0.4.4.tar.gz

Download URL maplibre_tiles-0.4.4.tar.gz
Size 554.7 kB
Tags Source
SHA-256 checksum
How to use checksums
91a2d3b91ecffca6f1f1eb1a37e974f22dfd69106c41d62a8ca036d54a43fa18
BLAKE2b-256 checksum
How to use checksums
d1c60f7b03f49f5823bb5af0c7b3acf1a07778e481262b415de1bb1c892f8a9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp315-cp315t-macosx_11_0_arm64.whl

Download URL maplibre_tiles-0.4.4-cp315-cp315t-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d19f0c9724898354dc2b6428fdb4ea7a530a6ac850fbd20ff3da9098a922e392
BLAKE2b-256 checksum
How to use checksums
83955322948bac0989cb303b87bdf6db3245f83d9ccaba375a0adb26592be161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp315-cp315-manylinux_2_31_x86_64.whl

Download URL maplibre_tiles-0.4.4-cp315-cp315-manylinux_2_31_x86_64.whl
Size 1.1 MB
Tags CPython 3.15 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
27510f5ee71b30d047d828505b4db14e9c3dad9cdd9594df9a2ac78153497d4e
BLAKE2b-256 checksum
How to use checksums
d878a214f4cb18b9377be54717112a8000bb1aa84592453b997d0ebfc3887f9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp315-cp315-macosx_11_0_arm64.whl

Download URL maplibre_tiles-0.4.4-cp315-cp315-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.15 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
12cb764cd96920d6b7ef064badfd0a327d0329f2673f56382afca60b4dbff284
BLAKE2b-256 checksum
How to use checksums
70ad0523c04e7137c3f83cae7c9ccd6d9a3f9f23b1e66b5dfc0d399812f7ac08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp314-cp314-macosx_11_0_arm64.whl

Download URL maplibre_tiles-0.4.4-cp314-cp314-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b61102d2b952af5d87d547cbdb72e12312ca1d200ce2529a3612e900d652577b
BLAKE2b-256 checksum
How to use checksums
773b0ed66591a53093138ce190b465fdd3eae5c54589bcdd2d1f43ce7d639a63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp314-cp314-macosx_10_12_x86_64.whl

Download URL maplibre_tiles-0.4.4-cp314-cp314-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.14 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9338e83b1bb4375c32e6c200a1caa3be83d9e4ca5c497b6e4b09e159d9bd44c0
BLAKE2b-256 checksum
How to use checksums
4d8200f13b65f99bad9d028c94d37ae352e273f55d30d4842cb18c9061a10ec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp313-cp313-macosx_11_0_arm64.whl

Download URL maplibre_tiles-0.4.4-cp313-cp313-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5d52d4783d26ea73c5c33fb80f05555f93b9e39f47f5b24553a75955b04151a1
BLAKE2b-256 checksum
How to use checksums
97e4c8aa00d8fedb475a071ec7d5385b454f2774327778c98b7e955d69b7c822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp313-cp313-macosx_10_12_x86_64.whl

Download URL maplibre_tiles-0.4.4-cp313-cp313-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1367a0e49ff78aa62d963dc8f3b9363dd2284499bb9e9b76b6378ac35842b1e2
BLAKE2b-256 checksum
How to use checksums
a13ced48c94fa5de226d121df502508d4a542c3cca63fa9231bc22ddf50f7bf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp312-cp312-macosx_11_0_arm64.whl

Download URL maplibre_tiles-0.4.4-cp312-cp312-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8f3604b6cf6deff98ef0e501739dbbdd2ba2103f4c88fc4feb841a195bd0fbb3
BLAKE2b-256 checksum
How to use checksums
5d84ffe6b8248584fd9fe6f68d807dad03b99cf1b84e829336e680ab530b3683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp312-cp312-macosx_10_12_x86_64.whl

Download URL maplibre_tiles-0.4.4-cp312-cp312-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d649e111ac8f45a3c3c285ed9af2f6459eb835fe59a12b6cc3d0cb7aef0128a4
BLAKE2b-256 checksum
How to use checksums
7bdfc83692023ffe8f2cc7d0a99b0da220f01a19eab7094beb1bcc32cf905066
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp311-cp311-macosx_11_0_arm64.whl

Download URL maplibre_tiles-0.4.4-cp311-cp311-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
63f1745c3d8b29f81f6b601a9d29892a91f5b6001b69b4233fe293dc936a1a8d
BLAKE2b-256 checksum
How to use checksums
1490a71eb4d04f5ef80c9ce8309fc98895b47c566b7fcbd96b143b5064fd251b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp311-cp311-macosx_10_12_x86_64.whl

Download URL maplibre_tiles-0.4.4-cp311-cp311-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
65e6a5542261373226c1f480ce6f3959fa5cde7782e1c31ca6007449d588be86
BLAKE2b-256 checksum
How to use checksums
898b7d7a5f73f607e1d3bc5b7400a74c1338e72506ca6bfd8c49713657621205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / maplibre_tiles-0.4.4-cp310-cp310-manylinux_2_31_x86_64.whl

Download URL maplibre_tiles-0.4.4-cp310-cp310-manylinux_2_31_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
6bae6d624406c40f36564809dc8e4e62207a840fb0873a94b3eaea01047dca68
BLAKE2b-256 checksum
How to use checksums
9b7ad7e643dfac019451a54a81e48b92f805ed7246643eea53c8247f44a69e6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for maplibre-tiles 0.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for maplibre_tiles-0.4.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.4 This release

13 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page