maplibre/martin

Generate MVT tiles from GeoJSON

Closed

#2,054 opened on Aug 19, 2025

 (3 comments) (2 reactions) (0 assignees)Rust (377 forks)auto 404
backendconfighelp wantedrustserving

Repository metrics

Stars
 (3,761 stars)
PR merge metrics
 (PR metrics pending)

Description

Per discussion in #1458, in order to support arbitrary geometry data providers (e.g. databases), we need Martin to be able to convert arbitrary geometries into tiles. GeoJSON is the simplest data provider, and thus can be used as the first step.

MVT encoding

Build/find a crate to encode arbitrary geometries as MVT. This is similar to what mapbox/wagyu library does (used by ST_AsMVT in Postgis).

  • convert geometry to webmercator
  • scale / offset to the correct tile coordinates
  • clip geometries to the tile boundaries + configurable buffer
  • fix any invalid geometries resulting from converting coordinates to integers or clipping

Serve GeoJSON

  • Decide GeoJSON tile source configuration - probably similar to .mbtiles files + extras like buffer size
  • Decide CLI-provided geojson sources

Contributor guide