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.3

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.3
File Size Uploaded Provenance Actions
maplibre_tiles-0.4.3.tar.gz 556.9 kB With provenance Details for maplibre_tiles-0.4.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for maplibre-tiles 0.4.3
File Actions
maplibre_tiles-0.4.3-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.3-cp315-cp315t-macosx_11_0_arm64.whl
maplibre_tiles-0.4.3-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.3-cp315-cp315-manylinux_2_31_x86_64.whl
maplibre_tiles-0.4.3-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.3-cp315-cp315-macosx_11_0_arm64.whl
maplibre_tiles-0.4.3-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.3-cp314-cp314-macosx_11_0_arm64.whl
maplibre_tiles-0.4.3-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.3-cp314-cp314-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.3-cp313-cp313-macosx_11_0_arm64.whl
maplibre_tiles-0.4.3-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.3-cp313-cp313-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.3-cp312-cp312-macosx_11_0_arm64.whl
maplibre_tiles-0.4.3-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.3-cp312-cp312-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.3-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for maplibre_tiles-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
maplibre_tiles-0.4.3-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.3-cp311-cp311-macosx_10_12_x86_64.whl
maplibre_tiles-0.4.3-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.3-cp310-cp310-manylinux_2_31_x86_64.whl

Total release size: 26.9 MB

Release files / maplibre_tiles-0.4.3.tar.gz

Download URL maplibre_tiles-0.4.3.tar.gz
Size 556.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6d9be3db08e90069ad52706aec1f85178c07064036b7631fa7a02498e3cbb4b6
BLAKE2b-256 checksum
How to use checksums
d7f908d2a8dcf1a063d7ee89bb2e5b8bb42b697ce04984a6e86e5032e54a921e
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
3a6a71fcec8938fbd04e1d212283638f05e7003a70ee70382095a1fb0fd06871
BLAKE2b-256 checksum
How to use checksums
2793b23609bfa19bf0613826377892eb99bb5c6dc55ce968cdd4592b85f09c7a
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-cp315-cp315-manylinux_2_31_x86_64.whl
Size 1.2 MB
Tags CPython 3.15 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
fd9c70a9aa640991bc54cc8d76993c43f5de0b51d26462e079f291a5123d660a
BLAKE2b-256 checksum
How to use checksums
a1e267d4ad3b6dcafe080a3c61286d3d195f1da8befa80e5ce6420e230f82504
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
cf6b2b3ba648cc51ccef852ae4cf7b1f8c5c4f492ef568c5ac7b3ff273ef08e5
BLAKE2b-256 checksum
How to use checksums
00325115af4cdd1158aec6e6f9615b746d9cbaf49658608c04c7eccb5b699561
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
62bbee8dc0ed023d53dad7a66f1ed26aaa53728e1c5ed217ff5baaa3508c4f00
BLAKE2b-256 checksum
How to use checksums
1c6f0dd2adb45c50fb48f66c16ff5d2fa18544283bf681ce2b3f63800fc0f2de
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
a25388a88d41e9b4c2ab22e7c9d6acc4da37eeb42426fe1f08c7e16ad7c1b5a0
BLAKE2b-256 checksum
How to use checksums
70b4122c34b92dd06a411d90a8e22ef767f3f28d8052b544c5362d5b609cf3ed
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
f028a8f012b5f3cb5902430a449608d1132c7920dff0446c8f5cde718ba0cd77
BLAKE2b-256 checksum
How to use checksums
e4a35b803ce6739e3007ecd73a983d8b04acade7cd6952a96606770be8117ae1
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
f4f6a8ad0979910fb0901f78b7ca55c24b90bbd715ed85268befea7edfdce835
BLAKE2b-256 checksum
How to use checksums
eaedacce33fad5a0a9559e04518beabed342ba0709a83b2a05c3f78deaef9f3b
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
00680cc8439e901092ee86f9b081de95a96b78c77d69a5522a986b38b5de4bce
BLAKE2b-256 checksum
How to use checksums
00ed13bca4693319cfe4ccf02843e1384d7ceb5cdd8de8fa0fda148bf82b4398
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
a1283ba3c8c165af52fb845ffbed8aeba1e7333f70956c978793cbb225b1d3db
BLAKE2b-256 checksum
How to use checksums
fd0d87d134aabe7518e7f97c5e973972c3096cb4a1d4f471fe64eb5703cf627c
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
302437e8065d7db0b3e3bd8fc4b2329add992652f3d38bcbb0873a39c7e7aa94
BLAKE2b-256 checksum
How to use checksums
d9743d1a6d5ab81930ea5c017793c9c40d70a26c95af9bd6bb93727d4502313b
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-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
7ebaa06c789404fd083a8d87e7e42cc7582a440c6167ea6a03d3767c8e5028ce
BLAKE2b-256 checksum
How to use checksums
f25737b5b2e0b97bdbea04011322fdae6ed8833a839deb71f911a3a1b3822653
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 22, 2026.

Transparency log

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

Download URL maplibre_tiles-0.4.3-cp310-cp310-manylinux_2_31_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
778960eefc4496b145aa990bbc3802ad6cb517d426d0c2410c9842459400c233
BLAKE2b-256 checksum
How to use checksums
536ff074243a756d212dcee23a99f7c61938e045ed9b50b2ec652c9ea8492db1
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 22, 2026.

Transparency log

Security for maplibre-tiles 0.4.3

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.3.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 22, 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.3 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