From 67680a06a58fa3850b2bca380f9655254826e8ec Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 18 Jan 2024 15:12:08 +0800 Subject: [PATCH] update tests and readme about minzoom [#120] --- README.md | 2 +- pmtiles/bitmap_test.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fea3f04..019bfa1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Convert an [MBTiles](https://github.com/mapbox/mbtiles-spec/tree/master/1.3) arc pmtiles extract INPUT.pmtiles OUTPUT.pmtiles --maxzoom=MAXZOOM --bucket=s3://BUCKET_NAME * `--region` a GeoJSON Polygon, Multipolygon, Feature, or FeatureCollection -* `--maxzoom=13` extract only a subset of zoom levels +* `--maxzoom=13`, `--minzoom=12` extract only a subset of zoom levels, see [docs for details](https://docs.protomaps.com/pmtiles/cli#extract) * `--download-threads` parallel requests to speed up downloads * `--overfetch` extra data to download to batch small requests: 0.05 is 5% diff --git a/pmtiles/bitmap_test.go b/pmtiles/bitmap_test.go index b66fbc0..1f412c8 100644 --- a/pmtiles/bitmap_test.go +++ b/pmtiles/bitmap_test.go @@ -36,3 +36,12 @@ func TestGeneralizeOr(t *testing.T) { assert.True(t, b.Contains(ZxyToId(1, 0, 0))) assert.True(t, b.Contains(ZxyToId(0, 0, 0))) } + +func TestGeneralizeOrMinZoom(t *testing.T) { + b := roaring64.New() + b.Add(ZxyToId(3, 0, 0)) + generalizeOr(b, 2) + assert.Equal(t, uint64(2), b.GetCardinality()) + assert.True(t, b.Contains(ZxyToId(2, 0, 0))) + assert.False(t, b.Contains(ZxyToId(1, 0, 0))) +}