Command-line Interface
You can configure Martin using command-line interface.
See martin --help
or cargo run -- --help
for more information:
Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support
Usage: martin [OPTIONS] [CONNECTION]...
Arguments:
[CONNECTION]...
Connection strings, e.g. postgres://... or /path/to/files
Options:
-c, --config <CONFIG>
Path to config file. If set, no tile source-related parameters are allowed
--save-config <SAVE_CONFIG>
Save resulting config to a file or use "-" to print to stdout. By default, only print if sources are auto-detected
-C, --cache-size <CACHE_SIZE>
Main cache size (in MB)
-s, --sprite <SPRITE>
Export a directory with SVG files as a sprite source. Can be specified multiple times
-f, --font <FONT>
Export a font file or a directory with font files as a font source (recursive). Can be specified multiple times
-S, --style <STYLE>
Export a style file or a directory with style files as a style source (recursive). Can be specified multiple times
-k, --keep-alive <KEEP_ALIVE>
Connection keep alive timeout. [DEFAULT: 75]
-l, --listen-addresses <LISTEN_ADDRESSES>
The socket address to bind. [DEFAULT: 0.0.0.0:3000]
--base-path <BASE_PATH>
Set TileJSON URL path prefix.
This overrides the default of respecting the X-Rewrite-URL header. Only modifies the JSON (TileJSON) returned, martins' API-URLs remain unchanged. If you need to rewrite URLs, please use a reverse proxy. Must begin with a /.
Examples: /, /tiles
-W, --workers <WORKERS>
Number of web server workers
--preferred-encoding <PREFERRED_ENCODING>
Martin server preferred tile encoding. [DEFAULT: gzip]
If the client accepts multiple compression formats, and the tile source is not pre-compressed, which compression should be used. gzip is faster, but brotli is smaller, and may be faster with caching.
[possible values: brotli, gzip]
-u, --webui <WEB_UI>
Control Martin web UI. [DEFAULT: disabled]
Possible values:
- disable: Disable Web UI interface. This is the default, but once implemented, the default will be enabled for localhost.
- enable-for-all: Enable Web UI interface on all connections
-b, --auto-bounds <AUTO_BOUNDS>
Specify how bounds should be computed for the spatial PG tables. [DEFAULT: quick]
Possible values:
- quick: Compute table geometry bounds, but abort if it takes longer than 5 seconds
- calc: Compute table geometry bounds. The startup time may be significant. Make sure all GEO columns have indexes
- skip: Skip bounds calculation. The bounds will be set to the whole world
--ca-root-file <CA_ROOT_FILE>
Loads trusted root certificates from a file. The file should contain a sequence of PEM-formatted CA certificates
-d, --default-srid <DEFAULT_SRID>
If a spatial PG table has SRID 0, then this default SRID will be used as a fallback
-p, --pool-size <POOL_SIZE>
Maximum Postgres connections pool size [DEFAULT: 20]
-m, --max-feature-count <MAX_FEATURE_COUNT>
Limit the number of geo features per tile.
If the source table has more features than set here, they will not be included in the tile and the result will look "cut off"/incomplete. This feature allows to put a maximum latency bound on tiles with extreme amount of detail at the cost of
not returning all data. It is sensible to set this limit if you have user generated/untrusted geodata, e.g. a lot of data points at Null Island.
Can be either a positive integer or unlimited if omitted.
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Use RUST_LOG environment variable to control logging level, e.g. RUST_LOG=debug or RUST_LOG=martin=debug. See https://docs.rs/env_logger/latest/env_logger/index.html#enabling-logging for more information.