Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling.
Go to file
dependabot[bot] f932f0103f
chore(deps): Bump moka from 0.12.1 to 0.12.2 (#1109)
Bumps [moka](https://github.com/moka-rs/moka) from 0.12.1 to 0.12.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/moka-rs/moka/blob/main/CHANGELOG.md">moka's
changelog</a>.</em></p>
<blockquote>
<h2>Version 0.12.2</h2>
<h3>Fixed</h3>
<ul>
<li>Prevent timing issues in writes that cause inconsistencies between
the cache's
internal data structures (<a
href="https://redirect.github.com/moka-rs/moka/issues/348">#348</a>[gh-pull-0348]):
<ul>
<li>One way to trigger the issue is that insert the same key twice
quickly, once
when the cache is full and a second time when there is a room in the
cache.
<ul>
<li>When it occurs, the cache will not return the value inserted in the
second
call (which is wrong), and the <code>entry_count</code> method will keep
returning a non
zero value after calling the <code>invalidate_all</code> method (which
is also wrong).</li>
</ul>
</li>
</ul>
</li>
<li>Now the last access time of a cached entry is updated immediately
after the entry
is read (<a
href="https://redirect.github.com/moka-rs/moka/issues/363">#363</a>[gh-pull-0363]):
<ul>
<li>When the time-to-idle of a cache is set, the last access time of a
cached entry
is used to determine if the entry has been expired.</li>
<li>Before this fix, the access time was updated (to the time when it
was read)
when pending tasks were processed. This delay caused issue that some
entries
become temporarily unavailable for reads even though they have been
accessed
recently. And then they will become available again after the pending
tasks are
processed.</li>
<li>Now the last access time is updated immediately after the entry is
read. The
entry will remain valid until the time-to-idle has elapsed.</li>
</ul>
</li>
</ul>
<p>Note that both of <a
href="https://redirect.github.com/moka-rs/moka/issues/348">#348</a>[gh-pull-0348]
and <a
href="https://redirect.github.com/moka-rs/moka/issues/363">#363</a>[gh-pull-0363]
were already present
in <code>v0.11.x</code> and older versions. However they were less
likely to occur because they
had background threads to periodically process pending tasks. So there
were much
shorter time windows for these issues to occur.</p>
<h3>Changed</h3>
<ul>
<li>Updated the Rust edition from 2018 to 2021. (<a
href="https://redirect.github.com/moka-rs/moka/issues/339">#339</a>[gh-pull-0339],
by
[<a
href="https://github.com/nyurik"><code>@​nyurik</code></a>][gh-nyurik])
<ul>
<li>The MSRV remains at Rust 1.65.</li>
</ul>
</li>
<li>Changed to use inline format arguments throughout the code,
including examples.
(<a
href="https://redirect.github.com/moka-rs/moka/issues/340">#340</a>[gh-pull-0340],
by [<a
href="https://github.com/nyurik"><code>@​nyurik</code></a>][gh-nyurik])</li>
</ul>
<h3>Added</h3>
<ul>
<li>Added an example for cascading drop triggered by eviction (<a
href="https://redirect.github.com/moka-rs/moka/issues/350">#350</a>[gh-pull-0350],
by
[<a
href="https://github.com/peter-scholtens"><code>@​peter-scholtens</code></a>][gh-peter-scholtens])</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="46a678b1a3"><code>46a678b</code></a>
Merge pull request <a
href="https://redirect.github.com/moka-rs/moka/issues/364">#364</a> from
moka-rs/prepare-v0.12.2</li>
<li><a
href="cdb002815a"><code>cdb0028</code></a>
Merge pull request <a
href="https://redirect.github.com/moka-rs/moka/issues/365">#365</a> from
moka-rs/tweak-cascading-drop-example</li>
<li><a
href="7d8f64fce5"><code>7d8f64f</code></a>
Fix a Clippy warning</li>
<li><a
href="cc3bbc3192"><code>cc3bbc3</code></a>
Update the cascading drop example to be more stable on different
platforms</li>
<li><a
href="e63c842c9d"><code>e63c842</code></a>
Merge pull request <a
href="https://redirect.github.com/moka-rs/moka/issues/350">#350</a> from
peter-scholtens/main</li>
<li><a
href="430dca1c1d"><code>430dca1</code></a>
Update the change log</li>
<li><a
href="b0c42ab7d6"><code>b0c42ab</code></a>
Update the change log</li>
<li><a
href="8e54573779"><code>8e54573</code></a>
Prepare for <code>v0.12.2</code> release</li>
<li><a
href="1c302a0e77"><code>1c302a0</code></a>
Merge branch 'moka-rs:main' into main</li>
<li><a
href="4e26b76d56"><code>4e26b76</code></a>
Merge pull request <a
href="https://redirect.github.com/moka-rs/moka/issues/363">#363</a> from
moka-rs/update-access-time-immediately</li>
<li>Additional commits viewable in <a
href="https://github.com/moka-rs/moka/compare/v0.12.1...v0.12.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=moka&package-manager=cargo&previous-version=0.12.1&new-version=0.12.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-29 02:50:49 +00:00
.cargo-husky/hooks Move some build commands to CI (#1101) 2023-12-24 23:43:58 -05:00
.github Try to fix sporadic macos test failures (#1104) 2023-12-25 13:44:12 -05:00
debian fix debian config example 2023-12-25 00:53:16 -05:00
demo chore(deps-dev): Bump vite from 4.5.0 to 4.5.1 in /demo/frontend (#1037) 2023-12-06 02:15:55 -05:00
docs Lots of small refactorings (#1107) 2023-12-26 07:43:47 +00:00
martin better bench test 2023-12-27 14:53:12 -05:00
martin-tile-utils doc links 2023-12-25 01:49:39 -05:00
mbtiles Lots of small refactorings (#1107) 2023-12-26 07:43:47 +00:00
tests PMTiles cache, refactor file configs, modularize (#1094) 2023-12-25 05:52:04 +00:00
.dockerignore Update Docker build process (#1022) 2023-11-23 21:14:32 -05:00
.gitignore add .vscode to gitignroe (#791) 2023-08-02 08:10:01 -04:00
Cargo.lock chore(deps): Bump moka from 0.12.1 to 0.12.2 (#1109) 2023-12-29 02:50:49 +00:00
Cargo.toml better bench test 2023-12-27 14:53:12 -05:00
CHANGELOG.md fix spaces 2023-10-12 16:10:24 -04:00
CODE_OF_CONDUCT.md feat: clean up readme and code of conduct (#382) 2022-08-11 07:06:12 -04:00
docker-compose.yml Implement http pmtiles (#991) 2023-12-22 06:01:50 +00:00
justfile better bench test 2023-12-27 14:53:12 -05:00
LICENSE-APACHE Clean up licensing per on-boarding (#364) 2022-07-06 08:25:45 -04:00
LICENSE-MIT Clean up licensing per on-boarding (#364) 2022-07-06 08:25:45 -04:00
logo.png docs: ✏️ add notes on debugging 2019-02-04 20:22:04 +03:00
README.md doc links 2023-12-25 01:49:39 -05:00
rustfmt.toml Minor refactor and cleanup (#716) 2023-06-15 18:36:41 -04:00
SECURITY_POLICY.txt Create SECURITY_POLICY.txt (#489) 2023-02-04 19:06:17 -05:00

Martin

Book docs.rs docs 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 (local or remote), 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.

Additionally, there are several tools 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 for complete documentation.

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 AMD-64 ARM-64
Linux .tar.gz (gnu)
.tar.gz (musl)
.deb
.tar.gz (musl)
macOS .tar.gz .tar.gz
Windows .zip

If you are using macOS and Homebrew you can install martin and mbtiles using Homebrew tap.

brew tap maplibre/martin
brew install 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
/sprite/{spriteID}[@2x].{json,png} Sprites (low and high DPI, index/png)
/font/{font}/{start}-{end} Font source
/font/{font1},…,{fontN}/{start}-{end} Composite Font source
/health Martin server health check: returns 200 OK

Re-use Martin as a library

Martin can be used as a standalone server, or as a library in your own Rust application. When used as a library, you can use the following features:

  • postgres - enable PostgreSQL/PostGIS tile sources
  • pmtiles - enable PMTile tile sources
  • mbtiles - enable MBTile tile sources
  • fonts - enable font sources
  • sprites - enable sprite sources

Documentation

See Martin book for complete documentation.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.