Revert doc book links - may break a few new ones (#1018)

- [x] Remove chapter numbers
- [x] Update file name of `using-endpoints.md` back
- [x] Update links

---------

Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
This commit is contained in:
Lucas 2023-11-21 16:06:27 +08:00 committed by GitHub
parent 8193866f04
commit 566e8fa948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 69 additions and 69 deletions

View File

@ -11,12 +11,12 @@
Martin is a tile server able to generate and serve [vector tiles](https://github.com/mapbox/vector-tile-spec) on the fly from large [PostGIS](https://github.com/postgis/postgis) databases, [PMTile](https://protomaps.com/blog/pmtiles-v3-whats-new), and [MBTile](https://github.com/mapbox/mbtiles-spec) files, allowing multiple tile sources to be dynamically combined into one. Martin optimizes for speed and heavy traffic, and is written in [Rust](https://github.com/rust-lang/rust).
Additionally, there are [several tools](https://maplibre.org/martin/50-tools.html) for generating tiles in bulk from any Martin-supported sources (similar to `tilelive-copy`), copying tiles between MBTiles files, creating deltas (patches) and applying them, and validating MBTiles files.
Additionally, there are [several tools](https://maplibre.org/martin/tools.html) for generating tiles in bulk from any Martin-supported sources (similar to `tilelive-copy`), copying tiles between MBTiles files, creating deltas (patches) and applying them, and validating MBTiles files.
See [Martin book](https://maplibre.org/martin/) for complete documentation.
## Installation
_See [installation instructions](https://maplibre.org/martin/10-installation.html) in the Martin book._
_See [installation instructions](https://maplibre.org/martin/installation.html) in the Martin book._
**Prerequisites:** If using Martin with PostgreSQL database, you must install PostGIS with at least v3.0+, v3.1+ recommended.
@ -45,11 +45,11 @@ brew install martin
```
## Running Martin Service
_See [running instructions](https://maplibre.org/martin/20-run.html) in the Martin book._
_See [running instructions](https://maplibre.org/martin/run.html) in the Martin book._
Martin supports any number of PostgreSQL/PostGIS database connections with [geospatial-enabled](https://postgis.net/docs/using_postgis_dbmanagement.html#geometry_columns) tables and tile-producing SQL functions, as well as [PMTile](https://protomaps.com/blog/pmtiles-v3-whats-new) and [MBTile](https://github.com/mapbox/mbtiles-spec) files as tile sources.
Martin can auto-discover tables and functions using a [connection string](https://maplibre.org/martin/31-pg-connections.html). A PG connection string can also be passed via the `DATABASE_URL` environment variable.
Martin can auto-discover tables and functions using a [connection string](https://maplibre.org/martin/pg-connections.html). A PG connection string can also be passed via the `DATABASE_URL` environment variable.
Each tile source will have a [TileJSON](https://github.com/mapbox/tilejson-spec) endpoint.
@ -72,7 +72,7 @@ martin --config config.yaml
```
#### Docker Example
_See [Docker instructions](https://maplibre.org/martin/22-run-with-docker.html) in the Martin book._
_See [Docker instructions](https://maplibre.org/martin/run-with-docker.html) in the Martin book._
Martin is also available as a [Docker image](https://ghcr.io/maplibre/martin). 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.
@ -86,7 +86,7 @@ docker run -p 3000:3000 \
```
## API
_See [API documentation](https://maplibre.org/martin/40-using-endpoints.html) in the Martin book._
_See [API documentation](https://maplibre.org/martin/using.html) in the Martin book._
Martin data is available via the HTTP `GET` endpoints:

2
debian/config.yaml vendored
View File

@ -7,7 +7,7 @@ listen_addresses: '0.0.0.0:3000'
# Number of web server workers
worker_processes: 8
# see https://maplibre.org/martin/30-config-file.html
# see https://maplibre.org/martin/config-file.html
# postgres:
# connection_string: 'postgresql://postgres@localhost:5432/db'

View File

@ -1,30 +1,30 @@
[Introduction](00-introduction.md)
- [Installation](10-installation.md)
- [Running](20-run.md)
- [Command Line Interface](21-run-with-cli.md)
- [Environment Variables](21-env-vars.md)
- [Running with Docker](22-run-with-docker.md)
- [Running with Docker Compose](23-run-with-docker-compose.md)
- [Running with NGINX](24-run-with-nginx.md)
- [Troubleshooting](25-troubleshooting.md)
- [Configuration File](30-config-file.md)
- [PostgreSQL Connections](31-pg-connections.md)
- [PostgreSQL Table Sources](32-sources-pg-tables.md)
- [PostgreSQL Function Sources](33-sources-pg-functions.md)
- [MBTiles and PMTiles File Sources](34-sources-files.md)
- [Composite Sources](35-sources-composite.md)
- [Sprite Sources](36-sources-sprites.md)
- [Font Sources](37-sources-fonts.md)
- [Usage and Endpoint API](40-using-endpoints.md)
- [Using with MapLibre](41-using-with-maplibre.md)
- [Using with Leaflet](42-using-with-leaflet.md)
- [Using with deck.gl](43-using-with-deck-gl.md)
- [Using with Mapbox](44-using-with-mapbox.md)
- [Recipes](45-recipes.md)
- [Tools](50-tools.md)
- [martin-cp bulk tile generation](501-martin-cp.md)
- [MBTiles Info and Metadata](51-mbtiles-meta.md)
- [MBTiles Copying / Diffing](52-mbtiles-copy.md)
- [MBTiles Validation](53-mbtiles-validation.md)
- [MBTiles Schemas](54-mbtiles-schema.md)
- [Development](60-development.md)
[Introduction](introduction.md)
- [Installation](installation.md)
- [Running](run.md)
- [Command Line Interface](run-with-cli.md)
- [Environment Variables](env-vars.md)
- [Running with Docker](run-with-docker.md)
- [Running with Docker Compose](run-with-docker-compose.md)
- [Running with NGINX](run-with-nginx.md)
- [Troubleshooting](troubleshooting.md)
- [Configuration File](config-file.md)
- [PostgreSQL Connections](pg-connections.md)
- [PostgreSQL Table Sources](sources-pg-tables.md)
- [PostgreSQL Function Sources](sources-pg-functions.md)
- [MBTiles and PMTiles File Sources](sources-files.md)
- [Composite Sources](sources-composite.md)
- [Sprite Sources](sources-sprites.md)
- [Font Sources](sources-fonts.md)
- [Usage and Endpoint API](using.md)
- [Using with MapLibre](using-with-maplibre.md)
- [Using with Leaflet](using-with-leaflet.md)
- [Using with deck.gl](using-with-deck-gl.md)
- [Using with Mapbox](using-with-mapbox.md)
- [Recipes](recipes.md)
- [Tools](tools.md)
- [martin-cp bulk tile generation](martin-cp.md)
- [MBTiles Info and Metadata](mbtiles-meta.md)
- [MBTiles Copying / Diffing](mbtiles-copy.md)
- [MBTiles Validation](mbtiles-validation.md)
- [MBTiles Schemas](mbtiles-schema.md)
- [Development](development.md)

View File

@ -1,6 +1,6 @@
## Environment Variables
You can also configure Martin using environment variables, but only if the configuration file is not used. See [configuration section](30-config-file.md) on how to use environment variables with config files. See also [SSL configuration](31-pg-connections.md#postgresql-ssl-connections) section below.
You can also configure Martin using environment variables, but only if the configuration file is not used. See [configuration section](config-file.md) on how to use environment variables with config files. See also [SSL configuration](pg-connections.md#postgresql-ssl-connections) section below.
| Environment var <br/> Config File key | Example | Description |
|------------------------------------------|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

View File

@ -4,7 +4,7 @@
## Usage
This copies tiles from a PostGIS table `my_table` into an MBTiles file `tileset.mbtiles` using [normalized](54-mbtiles-schema.md) schema, with zoom levels from 0 to 10, and bounds of the whole world.
This copies tiles from a PostGIS table `my_table` into an MBTiles file `tileset.mbtiles` using [normalized](mbtiles-schema.md) schema, with zoom levels from 0 to 10, and bounds of the whole world.
```shell
martin-cp --output-file tileset.mbtiles \

View File

@ -8,7 +8,7 @@ mbtiles copy src_file.mbtiles dst_file.mbtiles \
--min-zoom 0 --max-zoom 10
```
This command can also be used to generate files of different [supported schema](##supported-schema).
This command can also be used to generate files of different [supported schema](mbtiles-schema.md).
```shell
mbtiles copy normalized.mbtiles dst.mbtiles \

View File

@ -7,15 +7,15 @@ mbtiles validate src_file.mbtiles
```
## SQLite Integrity check
The `validate` command will run `PRAGMA integrity_check` on the file, and will fail if the result is not `ok`. The `--integrity-check` flag can be used to disable this check, or to make it more thorow with `full` value. Default is `quick`.
The `validate` command will run `PRAGMA integrity_check` on the file, and will fail if the result is not `ok`. The `--integrity-check` flag can be used to disable this check, or to make it more thorough with `full` value. Default is `quick`.
## Schema check
The `validate` command will verify that the `tiles` table/view exists, and that it has the expected columns and indexes. It will also verify that the `metadata` table/view exists, and that it has the expected columns and indexes.
## Per-tile validation
If the `.mbtiles` file uses [flat_with_hash](54-mbtiles-schema.md#flat-with-hash) or [normalized](54-mbtiles-schema.md#normalized) schema, the `validate` command will verify that the MD5 hash of the `tile_data` column matches the `tile_hash` or `tile_id` columns (depending on the schema).
If the `.mbtiles` file uses [flat_with_hash](mbtiles-schema.md#flat-with-hash) or [normalized](mbtiles-schema.md#normalized) schema, the `validate` command will verify that the MD5 hash of the `tile_data` column matches the `tile_hash` or `tile_id` columns (depending on the schema).
A typical Normalized schema generated by tools like [tilelive-copy](https://github.com/mapbox/TileLive#bintilelive-copy) use MD5 hash in the `tile_id` column. The Martin's `mbtiles` tool can use this hash to verify the content of each tile. We also define a new [flat-with-hash](54-mbtiles-schema.md#flat-with-hash) schema that stores the hash and tile data in the same table, allowing per-tile validation without the multiple table layout.
A typical Normalized schema generated by tools like [tilelive-copy](https://github.com/mapbox/TileLive#bintilelive-copy) use MD5 hash in the `tile_id` column. The Martin's `mbtiles` tool can use this hash to verify the content of each tile. We also define a new [flat-with-hash](mbtiles-schema.md#flat-with-hash) schema that stores the hash and tile data in the same table, allowing per-tile validation without the multiple table layout.
Per-tile validation is not available for the `flat` schema, and will be skipped.

View File

@ -4,6 +4,6 @@ Martin supports many of the PostgreSQL connection string settings such as `host`
### PostgreSQL SSL Connections
Martin supports PostgreSQL `sslmode` including `disable`, `prefer`, `require`, `verify-ca` and `verify-full` modes as described in the [PostgreSQL docs](https://www.postgresql.org/docs/current/libpq-ssl.html). Certificates can be provided in the configuration file, or can be set using the same env vars as used for `psql`. When set as env vars, they apply to all PostgreSQL connections. See [environment vars](21-env-vars.md) section for more details.
Martin supports PostgreSQL `sslmode` including `disable`, `prefer`, `require`, `verify-ca` and `verify-full` modes as described in the [PostgreSQL docs](https://www.postgresql.org/docs/current/libpq-ssl.html). Certificates can be provided in the configuration file, or can be set using the same env vars as used for `psql`. When set as env vars, they apply to all PostgreSQL connections. See [environment vars](env-vars.md) section for more details.
By default, `sslmode` is set to `prefer` which means that SSL is used if the server supports it, but the connection is not aborted if the server does not support it. This is the default behavior of `psql` and is the most compatible option. Use the `sslmode` param to set a different `sslmode`, e.g. `postgresql://user:password@host/db?sslmode=require`.

View File

@ -40,7 +40,7 @@ You can find an example NGINX configuration file [here](https://github.com/mapli
### Rewriting URLs
If you are running Martin behind NGINX proxy, you may want to rewrite the request URL to properly handle tile URLs in [TileJSON](40-using-endpoints.md#source-tilejson).
If you are running Martin behind NGINX proxy, you may want to rewrite the request URL to properly handle tile URLs in [TileJSON](using.md#source-tilejson).
```nginx
location ~ /tiles/(?<fwd_path>.*) {

View File

@ -1,6 +1,6 @@
# Usage
Martin requires at least one PostgreSQL [connection string](31-pg-connections.md) or a [tile source file](34-sources-files.md) as a command-line argument. A PG connection string can also be passed via the `DATABASE_URL` environment variable.
Martin requires at least one PostgreSQL [connection string](pg-connections.md) or a [tile source file](sources-files.md) as a command-line argument. A PG connection string can also be passed via the `DATABASE_URL` environment variable.
```shell
martin postgresql://postgres@localhost/db

View File

@ -6,4 +6,4 @@ Martin can serve any type of tiles from [PMTile](https://protomaps.com/blog/pmti
martin /path/to/mbtiles/file.mbtiles /path/to/directory
```
You may also want to generate a [config file](30-config-file.md) using the `--save-config my-config.yaml`, and later edit it and use it with `--config my-config.yaml` option.
You may also want to generate a [config file](config-file.md) using the `--save-config my-config.yaml`, and later edit it and use it with `--config my-config.yaml` option.

View File

@ -55,7 +55,7 @@ curl http://127.0.0.1:3000/catalog
## Using from CLI
A font file or directory can be configured from the [CLI](21-run-with-cli.md) with one or more `--font` parameters.
A font file or directory can be configured from the [CLI](run-with-cli.md) with one or more `--font` parameters.
```shell
martin --font /path/to/font/file.ttf --font /path/to/font_dir

View File

@ -1,6 +1,6 @@
## Table Sources
Table Source is a database table which can be used to query [vector tiles](https://github.com/mapbox/vector-tile-spec). If a [PostgreSQL connection string](31-pg-connections.md) is given, Martin will publish all tables as data sources if they have at least one geometry column. If geometry column SRID is 0, a default SRID must be set, or else that geo-column/table will be ignored. All non-geometry table columns will be published as vector tile feature tags (properties).
Table Source is a database table which can be used to query [vector tiles](https://github.com/mapbox/vector-tile-spec). If a [PostgreSQL connection string](pg-connections.md) is given, Martin will publish all tables as data sources if they have at least one geometry column. If geometry column SRID is 0, a default SRID must be set, or else that geo-column/table will be ignored. All non-geometry table columns will be published as vector tile feature tags (properties).
### Modifying Tilejson
@ -39,7 +39,7 @@ The TileJSON:
}
```
By default the `description` and `name` is database identifies about this table, and the bounds is queried from database. You can fine tune these by adjusting `auto_publish` section in [configuration file](https://maplibre.org/martin/30-config-file.html#config-example).
By default the `description` and `name` is database identifies about this table, and the bounds is queried from database. You can fine tune these by adjusting `auto_publish` section in [configuration file](https://maplibre.org/martin/config-file.html#config-example).
#### TileJSON in SQL Comments

View File

@ -39,7 +39,7 @@ martin --sprite /path/to/sprite_a --sprite /path/to/other/sprite_b
### Configuring with Config File
A sprite directory can be configured from the config file with the `sprite` key, similar to how [MBTiles and PMTiles](30-config-file.md) are configured.
A sprite directory can be configured from the config file with the `sprite` key, similar to how [MBTiles and PMTiles](config-file.md) are configured.
```yaml
# Sprite configuration

View File

@ -1,8 +1,8 @@
## Using with Mapbox
[Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js) is a JavaScript library for interactive, customizable vector maps on the web. Mapbox GL JS v1.x was open source, and it was forked as MapLibre, so using Martin with Mapbox is similar to MapLibre described [here](41-using-with-maplibre.md). Mapbox GL JS can accept [MVT vector tiles](https://github.com/mapbox/vector-tile-spec) generated by Martin, and applies [a style](https://docs.mapbox.com/mapbox-gl-js/style-spec/) to them to draw a map using Web GL.
[Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js) is a JavaScript library for interactive, customizable vector maps on the web. Mapbox GL JS v1.x was open source, and it was forked as MapLibre, so using Martin with Mapbox is similar to MapLibre described [here](using-with-maplibre.md). Mapbox GL JS can accept [MVT vector tiles](https://github.com/mapbox/vector-tile-spec) generated by Martin, and applies [a style](https://docs.mapbox.com/mapbox-gl-js/style-spec/) to them to draw a map using Web GL.
You can add a layer to the map and specify Martin TileJSON endpoint as a vector source URL. You should also specify a `source-layer` property. For [Table Sources](32-sources-pg-tables.md) it is `{table_name}` by default.
You can add a layer to the map and specify Martin TileJSON endpoint as a vector source URL. You should also specify a `source-layer` property. For [Table Sources](sources-pg-tables.md) it is `{table_name}` by default.
```js
map.addLayer({

View File

@ -2,7 +2,7 @@
[MapLibre](https://maplibre.org/projects/maplibre-gl-js/) is an Open-source JavaScript library for showing maps on a website. MapLibre can accept [MVT vector tiles](https://github.com/mapbox/vector-tile-spec) generated by Martin, and applies [a style](https://maplibre.org/maplibre-gl-js-docs/style-spec/) to them to draw a map using Web GL.
You can add a layer to the map and specify Martin [TileJSON](https://github.com/mapbox/tilejson-spec) endpoint as a vector source URL. You should also specify a `source-layer` property. For [Table Sources](32-sources-pg-tables.md) it is `{table_name}` by default.
You can add a layer to the map and specify Martin [TileJSON](https://github.com/mapbox/tilejson-spec) endpoint as a vector source URL. You should also specify a `source-layer` property. For [Table Sources](sources-pg-tables.md) it is `{table_name}` by default.
```js
@ -36,7 +36,7 @@ map.addLayer({
});
```
You can also combine multiple sources into one source with [Composite Sources](35-sources-composite.md). Each source in a composite source can be accessed with its `{source_name}` as a `source-layer` property.
You can also combine multiple sources into one source with [Composite Sources](sources-composite.md). Each source in a composite source can be accessed with its `{source_name}` as a `source-layer` property.
```js
map.addSource('points', {

View File

@ -2,18 +2,18 @@
Martin data is available via the HTTP `GET` endpoints:
| URL | Description |
|-----------------------------------------|----------------------------------------------|
| `/` | Status text, that will eventually show web UI |
| `/catalog` | [List of all sources](#catalog) |
| `/{sourceID}` | [Source TileJSON](#source-tilejson) |
| `/{sourceID}/{z}/{x}/{y}` | Map Tiles |
| `/{source1},…,{sourceN}` | [Composite Source TileJSON](#source-tilejson) |
| `/{source1},…,{sourceN}/{z}/{x}/{y}` | [Composite Source Tiles](30-config-file.md) |
| `/sprite/{spriteID}[@2x].{json,png}` | [Sprite sources](36-sources-spritess.md) |
| `/font/{font}/{start}-{end}` | [Font source](37-sources-fonts.md) |
| `/font/{font1},…,{fontN}/{start}-{end}` | [Composite Font source](37-sources-fonts.md) |
| `/health` | Martin server health check: returns 200 `OK` |
| URL | Description |
|-----------------------------------------|------------------------------------------------|
| `/` | Status text, that will eventually show web UI |
| `/catalog` | [List of all sources](#catalog) |
| `/{sourceID}` | [Source TileJSON](#source-tilejson) |
| `/{sourceID}/{z}/{x}/{y}` | Map Tiles |
| `/{source1},…,{sourceN}` | [Composite Source TileJSON](#source-tilejson) |
| `/{source1},…,{sourceN}/{z}/{x}/{y}` | [Composite Source Tiles](sources-composite.md) |
| `/sprite/{spriteID}[@2x].{json,png}` | [Sprite sources](sources-sprites.md) |
| `/font/{font}/{start}-{end}` | [Font source](sources-fonts.md) |
| `/font/{font1},…,{fontN}/{start}-{end}` | [Composite Font source](sources-fonts.md) |
| `/health` | Martin server health check: returns 200 `OK` |
### Duplicate Source ID
In case there is more than one source that has the same name, e.g. a PG function is available in two schemas/connections, or a table has more than one geometry columns, sources will be assigned unique IDs such as `/points`, `/points.1`, etc.

View File

@ -1,6 +1,6 @@
# mbtiles
[![Book](https://img.shields.io/badge/docs-Book-informational)](https://maplibre.org/martin/50-tools.html)
[![Book](https://img.shields.io/badge/docs-Book-informational)](https://maplibre.org/martin/tools.html)
[![docs.rs docs](https://docs.rs/mbtiles/badge.svg)](https://docs.rs/mbtiles)
[![Slack chat](https://img.shields.io/badge/Chat-on%20Slack-blueviolet)](https://slack.openstreetmap.us/)
[![GitHub](https://img.shields.io/badge/github-maplibre/martin-8da0cb?logo=github)](https://github.com/maplibre/martin)
@ -9,7 +9,7 @@
A library to help tile servers like [Martin](https://maplibre.org/martin) work with [MBTiles](https://github.com/mapbox/mbtiles-spec) files. When using as a lib, you may want to disable default features (i.e. the unused "cli" feature).
This crate also has a small utility that allows users to interact with the `*.mbtiles` files from the command line. See [tools](https://maplibre.org/martin/50-tools.html) documentation for more information.
This crate also has a small utility that allows users to interact with the `*.mbtiles` files from the command line. See [tools](https://maplibre.org/martin/tools.html) documentation for more information.
### Development