Commit Graph

14 Commits

Author SHA1 Message Date
Yuri Astrakhan
b71c846abc
fix for mbtiles apply-patch with raw bindiff (#1384)
When applying raw (no gzip) patches, `mbtiles` was trying to un-gzip
them first. Now handles it properly.  Also adds a number of tests to catch these cases.
2024-06-26 20:37:20 +00:00
Yuri Astrakhan
ccd550a2cf
Add binary diff for mbtiles (#1358)
* `mbtiles diff` now has an additional `--patch-type` param with
`whole`, `bin-diff-raw` and `bin-diff-gz` values:
* `whole` stores different tiles as before - as whole tiles in the
`tiles` table
* `bin-diff-raw` computes binary difference between tiles, and stores
them as brotli-encoded value in a `bsdiffraw` table, together with a
`xxh3_64` hash of the tile as it will be stored after patching
* `bin-diff-gz` same as `bin-diff-raw`, but assumes the tiles are
gzip-compressed, so it uncompresses them before comparing. The `xxh3_64`
stores the hash of the uncompressed tile. The data will be stored in the
`bsdiffrawgz` table (identical structure with above)

* `mbtiles copy --apply-patch` will automatically detect if
`bsdiffrawgz` or `bsdiffraw` tables exist, and will use binary patching.
* `mbtiles apply-patch` does not support binary patching yet
* `mbtiles copy --diff-with-file ... --patch-type ...` is an alias to
`mbtiles diff --patch-type ...`
2024-06-25 19:34:14 +00:00
Yuri Astrakhan
6320e0fff3
Add agg_tiles_hash_before_apply, warnings, and validate on patch (#1266)
Implement #1244
2024-05-30 18:28:34 +00:00
Yuri Astrakhan
566f91d4cd
upgrade dependencies, Nasm on Windows (#1295)
* Install `nasm` when running CI on Windows (required by rustls new
faster crypto-provider)
* In integration testing, wrap connection in mutex due to `rstest` now
requiring `once` fixtures to be `Sync`
* Upgrade to Brotli v4, and disable FFI due to compilation conflict
2024-04-09 19:36:40 -04:00
Yuri Astrakhan
7107db5887
Fix apply-patch documentation (#1261) 2024-03-18 09:17:30 +08:00
Yuri Astrakhan
1c95c60ebd
Update lock, insta version deprecation, some test changes (#1240)
* Some small test cleanups
* A bump to dependencies
* Disable sprite generation test - PNGs tests are too flaky
* Add an mbtiles copy test for empty diffs
2024-03-11 01:14:27 -04:00
Yuri Astrakhan
e0c960a1b6
test: add tests for empty mbtiles (#1218)
They all seem to pass, but good to ensure we test the usecase of empty
mbtiles
2024-02-27 07:48:06 +00:00
Yuri Astrakhan
f13c3f7514
Improve mbtiles update, update min/max zoom on martin-cp (#1096)
* `mbtiles update` now allows different types of zoom updates - reset to
content, grow only, or skip (dry run)
* `martin-cp` will now update (grow-only) metadata zooms

Addresses a few concerns in the #1081
2023-12-24 17:30:45 +08:00
Yuri Astrakhan
1a8e7c89a4
Implement http pmtiles (#991)
PMTiles is a web-optimized format, allowing the actual file to be read
with HTTP range requests. Supporting this use case instantly allows
Martin to function as a lambda executable accessing PMTiles, but without
any significant investment into devops or hosting large file.

PMTiles config now also allows `http` and `https` protocol.

```
# Publish PMTiles files
pmtiles:
  paths:
    # specific pmtiles file will be published as mypmtiles source
    # (use last portion of the URL without extension)
    - http://example.org/path/to/mypmtiles.pmtiles
  sources:
    # named source matching source name to a single file
    pm-src1: https://example.org/path/to/some_pmtiles.pmtiles
 ```

fixes #884

---------

Co-authored-by: Kyle Slugg-Urbino <35903887+kyleslugg@users.noreply.github.com>
2023-12-22 06:01:50 +00:00
Yuri Astrakhan
24819bdb45
Multiple mbtiles and martin-cp fixes (#1083)
* BREAKING: `martin-cp` will now set `format=pbf` instead of `mvt`. This
is what QGIS and possibly others expect, and this is what tools like
tilelive generates.
* `martin-cp` sets `minzoom` and `maxzoom` metadata values based on the
zoom parameters
* Add `mbtiles meta-update` command to refresh zoom levels based on the
present tiles.

Partially addresses items in #1081
2023-12-18 23:19:36 -05:00
Yuri Astrakhan
de6b681d74
New mbtiles copy --copy (all|tiles|metadata) flag to limit what gets copied (#1073)
Limit what gets copied from one mbtiles to another.

Closes #1069
2023-12-16 14:59:52 -05:00
Yuri Astrakhan
b77bc892bf
Minor test snapshot cleanup (#1074) 2023-12-16 11:49:21 -05:00
Yuri Astrakhan
bb802c5688
Feature: mbtiles copy --bbox ... to copy tiles within a bbox only (#1060)
Allow users to copy tiles between mbtiles files that are only within a
bounding box. Multiple `--bbox` params are allowed.
2023-12-15 23:13:57 -05:00
Yuri Astrakhan
b97f1ccdbe Move utils to v0.2, MAX_ZOOM 2023-12-09 10:19:49 -05:00