Skip to content

Commit

Permalink
update tests and readme about minzoom [#120]
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Jan 18, 2024
1 parent fde7b36 commit 67680a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%

Expand Down
9 changes: 9 additions & 0 deletions pmtiles/bitmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}

0 comments on commit 67680a0

Please sign in to comment.