5969150f50
This will be the entry point for #667 |
||
---|---|---|
.cargo | ||
.cargo-husky/hooks | ||
.github | ||
benches | ||
demo | ||
docs | ||
homebrew-formula | ||
martin-mbtiles | ||
martin-tile-utils | ||
src | ||
tests | ||
.dockerignore | ||
.gitignore | ||
arm64.Dockerfile | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
docker-compose.yml | ||
Dockerfile | ||
justfile | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
logo.png | ||
nginx.conf | ||
README.md | ||
release.toml | ||
rustfmt.toml | ||
SECURITY_POLICY.txt |
Martin
Martin is a tile server able to generate vector tiles on the fly from large PostGIS databases, or serve tiles from PMTile and MBTile files. Martin optimizes for speed and heavy traffic, and is written in Rust.
See Martin book for complete documentation.
Requirements
When using Martin with PostgreSQL, you must install PostGIS with at least v3.0+, and v3.1+ is recommended.
Installation
You can download martin from GitHub releases page.
Platform | Downloads (latest) |
---|---|
Linux | 64-bit |
macOS | 64-bit |
Windows | 64-bit |
If you are using macOS and Homebrew you can install martin using Homebrew tap.
brew tap maplibre/martin https://github.com/maplibre/martin.git
brew install maplibre/martin/martin
You can also use official Docker image
export PGPASSWORD=postgres # secret!
docker run \
-p 3000:3000 \
-e PGPASSWORD \
-e DATABASE_URL=postgresql://user@host:port/db \
ghcr.io/maplibre/martin
Use docker -v
param to share configuration file or its directory with the container:
export PGPASSWORD=postgres # secret!
docker run -p 3000:3000 \
-e PGPASSWORD \
-e DATABASE_URL=postgresql://user@host:port/db \
-v /path/to/config/dir:/config \
ghcr.io/maplibre/martin --config /config/config.yaml
Usage
PostGIS sources
Martin requires at least one PostgreSQL connection string or a tile source file as a command-line argument. A PG connection string can also be passed via the DATABASE_URL
environment variable.
martin postgresql://user:password@host:port/database
Martin provides TileJSON endpoint for each geospatial-enabled table in your database.
MBTiles and PMTiles sources
Martin can serve any type of tiles from PMTile and MBTile files. To serve a file from CLI, simply put the path to the file or the directory with *.mbtiles
or *.pmtiles
files. For example:
martin /path/to/mbtiles/file.mbtiles
martin /path/to/directory
API
When started, Martin will go through all spatial tables and functions with an appropriate signature in the database. These tables and functions will be available as the HTTP endpoints, which you can use to query Mapbox vector tiles.
Method | URL | Description |
---|---|---|
GET |
/ |
Status text, that will eventually show web UI |
GET |
/catalog |
List of all sources |
GET |
/{sourceID} |
Source TileJSON |
GET |
/{sourceID}/{z}/{x}/{y} |
Source Tiles |
GET |
/{sourceID1},...,{nameN} |
Composite Source TileJSON |
GET |
/{sourceID1},...,{nameN}/{z}/{x}/{y} |
Composite Source Tiles |
GET |
/health |
Martin server health check: returns 200 OK |
Documentation
See Martin book for complete documentation.