Skip to content

Commit

Permalink
Add .mbtiles support (#549)
Browse files Browse the repository at this point in the history
Adds a new [.mbtiles](https://github.com/mapbox/mbtiles-spec/blob/master/1.3/spec.md)
backend, without the grid support. Uses extensive tile content
detection, i.e. if the content is gzipped, png, jpeg, gif, webp.

From CLI, can be as easy as adding a path to a directory that contains a
.mbtiles file (works just like pmtiles support)

```bash
# All *.mbtiles files in this dir will be published.
# The filename will be used as the source ID
martin ./tests/fixtures
```

From configuration file, the path can be specified in a number of ways
(same as pmtiles)

```yaml
mbtiles:
  paths:
    # scan this whole dir, matching all *.mbtiles files
    - /dir-path
    # specific mbtiles file will be published as mbtiles2 source
    - /path/to/mbtiles2.mbtiles
  sources:
      # named source matching source name to a single file
      pm-src1: /tmp/mbtiles.mbtiles
      # named source, where the filename is explicitly set. This way we will be able to add more options later
      pm-src2:
        path: /tmp/mbtiles.mbtiles
```

Fixes #494
  • Loading branch information
nyurik authored Jan 9, 2023
1 parent ba65e34 commit 9e5ed2f
Show file tree
Hide file tree
Showing 52 changed files with 1,692 additions and 240 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
installsqlx = "install sqlx-cli --no-default-features --features sqlite,native-tls"
sqlxprep = "sqlx prepare --merged --database-url sqlite://mbtiles/data/geography-class-jpg.mbtiles"
Loading

0 comments on commit 9e5ed2f

Please sign in to comment.