Knowledge Base updated: 2026-11-22
Martin knowledge base
Martin is a Rust workspace for serving and generating geospatial tiles. Its main components are the Martin server, shared tile abstractions, tile-generation tools, MBTiles and COG libraries, and the Martin web dashboard.
Critical runtime state lives in configured source catalogs, caches, connection pools, and reloadable server resources. Persistent tile/archive state is held in MBTiles, PMTiles, PostgreSQL, and raster/object-store inputs.
flowchart TD
Config[Configuration files and CLI] --> Server[Martin server]
Server --> Catalog[Tile source manager and catalog]
Server --> APIs[HTTP, OGC API, styles, sprites, fonts]
APIs --> Tiles[Tile request pipeline]
Catalog --> Tiles
Tiles --> Core[Martin Core tile abstractions]
Core --> Postgres[PostgreSQL sources]
Core --> Files[MBTiles, PMTiles, GeoJSON, DuckDB]
Core --> Raster[COG and raster processing]
Server --> Resources[Style resources and render pool]
Tilegen[Tile generation] --> Archives[MBTiles and PMTiles archives]
Dashboard[Martin web dashboard] --> APIs
Glossary
- Tile source manager — server-owned registry that exposes configured tile sources through the catalog.
- Auto-publish — discovery/configuration behavior that exposes eligible source objects without individually declaring each one.
- MLT — MapLibre Tile encoding supported alongside vector-tile responses and processing paths.
- Tilegen — the archive-generation subsystem that transforms source data through plans and output sinks.
- Render pool — scheduling pool used to render server-managed map styles.
Invariants
- Source discovery and runtime source lifecycle must remain coordinated through
crates/martin/src/config/file/main/**and crates/…/tile_source_manager.rs. - Public HTTP routing must preserve alignment with handlers under
crates/martin/src/srv/**. - Tile implementations must conform to the shared abstractions under
crates/martin-core/src/tiles/{source,tile,catalog,cache}.rs. - MBTiles schema and access behavior must remain compatible with initialization SQL under
crates/mbtiles/sql/**. - Dashboard API usage must remain compatible with server endpoints through
crates/martin-ui/src/lib/{api,martin-client}.ts.
Routing table
crates/martin/src/{bin,lib}.rs-> docs/martin-server-runtime.mdcrates/martin/src/srv/{server,mod,error}.rs-> docs/martin-server-runtime.mdcrates/martin/src/srv/{ogcapi,tiles,styles,sprites,fonts,admin}/**-> docs/http-apis-and-map-resources.mdcrates/martin/src/config/{args,file,primitives}/**-> docs/configuration-and-reload.mdcrates/martin/src/{tile_source_manager,source,reload}.rs-> docs/source-catalog-and-lifecycle.mdcrates/martin/src/config/file/main/**-> docs/source-catalog-and-lifecycle.mdcrates/martin/src/srv/{styles_rendering.rs,styles_rendering/**,styles_static.rs}-> docs/style-resources-and-rendering.mdcrates/martin-core/src/tiles/{any,cache,catalog,source,tile}.rs-> docs/tile-serving.mdcrates/martin-core/src/tiles/{mbtiles,pmtiles,geojson,duckdb,passthrough}/**-> docs/file-and-remote-tile-sources.mdcrates/martin-core/src/tiles/postgres/**-> docs/postgres-tile-sources.mdcrates/martin-core/src/tiles/{raster_codecs.rs,contour/**,hillshade/**,neighbourhood/**}-> docs/raster-terrain-and-transcoding.mdcrates/martin/src/generate/**-> docs/tile-generation.mdcrates/tilegen/src/{pipeline,plan,expression,filter,sort}/**-> docs/tilegen-pipeline-and-plans.mdcrates/tilegen/src/{input,source,sink,output}/**-> docs/tilegen-inputs-and-output-sinks.mdcrates/martin/src/generate/{osm.rs,layers.rs}-> docs/openstreetmap-tile-generation.mdcrates/mbtiles/src/{lib,db,metadata,pool,schema}.rs-> docs/mbtiles-storage.mdcrates/mbtiles/sql/**-> docs/mbtiles-storage.mdcrates/mbtiles/src/{copy,patch,pack,validate,transcode,summary,update,diff}/**-> docs/mbtiles-archive-operations.mdcrates/cog/src/{lib,source,tile,mosaic,reproject,encode}/**-> docs/cog-raster-tiles.mdcrates/cog/src/{backend,object_store,python}/**-> docs/cog-backends-and-python-bindings.mdcrates/maplibre-tile-toolkit/src/**-> docs/geospatial-tooling.mdcrates/{maplibre-tile-toolkit,martin-core}/src/**/{geometry,grid,rect,tile,coordinate,decoder}*-> docs/geometry-and-tile-primitives.mdcrates/e2e-tests/**-> docs/operations-and-quality.mdcrates/martin-ui/**-> docs/martin-web-dashboard.md