• Stars
    star
    2,231
  • Rank 20,649 (Top 0.5 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling.

Martin

Book docs.rs docs Slack chat GitHub crates.io version Security audit CI build

Martin is a tile server able to generate and serve vector tiles on the fly from large PostGIS databases, PMTile, and MBTile files, allowing multiple tile sources to be dynamically combined into one. Martin optimizes for speed and heavy traffic, and is written in Rust.

See Martin book for complete documentation.

Martin

Installation

See installation instructions in the Martin book.

Prerequisites: If using Martin with PostgreSQL database, you must install PostGIS with at least v3.0+, v3.1+ recommended.

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

Running Martin Service

See running instructions in the Martin book.

Martin supports any number of PostgreSQL/PostGIS database connections with geospatial-enabled tables and tile-producing SQL functions, as well as PMTile and MBTile files as tile sources.

Martin can auto-discover tables and functions using a connection string. A PG connection string can also be passed via the DATABASE_URL environment variable.

Each tile source will have a TileJSON endpoint.

Examples

# publish all tables and functions from a single database
export DATABASE_URL="postgresql://user:password@host:port/database"
martin

# same as above, but passing connection string via CLI, together with a directory of .mbtiles/.pmtiles files  
martin postgresql://user:password@host:port/database path/to/dir

# publish all discovered tables/funcs from two DBs
# and generate config file with all detected sources
martin postgres://... postgres://...  --save-config config.yaml

# use configuration file instead of auto-discovery
martin --config config.yaml

Docker Example

See Docker instructions in the Martin book.

Martin is also available as a Docker image. You could either share a configuration file from the host with the container via the -v param, or you can let Martin auto-discover all sources e.g. by passing DATABASE_URL or specifying the .mbtiles/.pmtiles files.

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

API

See API documentation in the Martin book.

Martin data is available via the HTTP GET endpoints:

URL Description
/ Status text, that will eventually show web UI
/catalog List of all sources
/{sourceID} Source TileJSON
/{sourceID}/{z}/{x}/{y} Map Tiles
/{source1},...,{sourceN} Composite Source TileJSON
/{source1},...,{sourceN}/{z}/{x}/{y} Composite Source Tiles
/health Martin server health check: returns 200 OK

Documentation

See Martin book for complete documentation.

More Repositories

1

maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
TypeScript
6,404
star
2

maputnik

An open source visual editor for the 'MapLibre Style Specification'
TypeScript
2,094
star
3

maplibre-rs

Experimental Maps for Web, Mobile and Desktop
Rust
1,343
star
4

maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
C++
1,048
star
5

awesome-maplibre

A collection of awesome things that use or support MapLibre!
378
star
6

flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
Dart
210
star
7

maplibre-react-native

A MapLibre react native module for creating custom maps
Java
209
star
8

maplibre-tile-spec

Next generation vector tiles format
Java
171
star
9

font-maker

Web app to convert font files into fontstacks for MapLibre GL
TypeScript
161
star
10

maplibre-gl-leaflet

This is a binding from MapLibre GL JS to the familiar Leaflet API.
JavaScript
123
star
11

maplibre-navigation-android

Maplibre Navigation SDK for Android
Java
91
star
12

demotiles

Demo vector tiles and map style for web, helloworld and CI tests @MapLibre. Hosted directly on GitHub Pages, serverless, no keys.
HTML
74
star
13

maplibre

Documents that span across multiple MapLibre projects
73
star
14

ngx-maplibre-gl

Angular binding of maplibre-gl
TypeScript
73
star
15

maplibre-gl-directions

A plugin to show routing directions on a MapLibre GL JS map
TypeScript
72
star
16

maplibre-style-spec

MapLibre Style Specification & Utilities
TypeScript
66
star
17

mbtileserver-rs

Deprecated mbtiles server in Rust. Use Martin tile server instead.
Rust
61
star
18

maplibre-gl-native-distribution

MapLibre Native for iOS distributed via the Swift Package Manager.
Swift
51
star
19

maplibre-gl-inspect

Maplibre GL Inspect adds an inspect control to maplibre-gl-js to view all features of the vector sources and allows hovering over features to see their properties.
TypeScript
39
star
20

maplibre-native-qt

MapLibre Native Qt Bindings and Qt Location Plugin
C++
38
star
21

maplibre-navigation-ios

MapLibre Navigation SDK for iOS
Swift
36
star
22

maplibre-navigation-android-legacy

Legacy MapLibre Navigation SDK for Android
Java
33
star
23

maplibre-gl-compare

Swipe and sync between two maps
JavaScript
32
star
24

maplibre-gl-js-docs

Deprecated - Docs are in the /docs folder of the maplibre-gl-js repo.
JavaScript
23
star
25

maplibre-plugins-android

MapLibre Native for Android Plugins
Java
22
star
26

maplibre-java

MapLibre Native Android utilities
Java
16
star
27

maplibre.github.io

HTML
13
star
28

maplibre-native-base

MapLibre Native Base C++ Libraries
C++
4
star
29

maplibre-native-android-examples

MapLibre Native Android Examples
3
star
30

workshop

HTML
2
star
31

mvt-cpp

C++ library for decoding MVT files
C++
2
star
32

martin-landing-page

JavaScript
1
star
33

maplibre-gestures-android

The MapLibre Gestures for Android library makes it easy to detect and handle user gestures on an Android device.
Java
1
star
34

homebrew-martin

Homebrew for Martin
Ruby
1
star
35

repo-stats

A repository to get statistics on other maplibre repos
1
star