Add support for pmtiles output format (#55)

* add pmtiles.hpp from github.com/protomaps/PMTiles [#10]

* tippecanoe main writes pmtiles output. [#10]

* detect output format using suffix
* after mbtiles is done writing, replace with pmtiles based on map/image tables.
* add method to write_json for writing json sub-object.

* tippecanoe-decode reads pmtiles input. [#10]

* tile-join reads and writes pmtiles. [#10]

* pmtiles test suite for decode and tile-join [#10]

* add base GitHub CI action for compiling and test suite.

* update pmtiles.hpp with z>15 fix

* Fix some ordering problems with pmtiles decode

* Pmtiles should also pass the raw tiles tests

* Eradicate spaces from tileset metadata JSON fields

* Eradicate spaces from more test fixtures

* Update more tests

* Pmtiles tests pass now too

* Remove unnecessary sort (and make indent)

* Update changelog

* The allow-existing test for pmtiles needs -o, not -e

* Declare --allow-existing to be unsupported for pmtiles.

It was always a bad idea even for mbtiles.

Co-authored-by: Brandon Liu <bdon@bdon.org>
This commit is contained in:
Erica Fischer
2022-12-29 12:00:13 -08:00
committed by GitHub
co-authored by Brandon Liu
parent a374263466
commit 3b2599f587
197 changed files with 2517 additions and 325 deletions
@@ -4,7 +4,7 @@
"description": "tests/grid-unaligned/out/-z11_-D7_--grid-low-zooms.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/grid-unaligned/out/-z11_-D7_--grid-low-zooms.json.check.mbtiles -z11 -D7 --grid-low-zooms tests/grid-unaligned/in.json",
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 11, \"fields\": {\"KPI\": \"Number\", \"Lat\": \"String\", \"Long\": \"String\", \"Tile\": \"Number\", \"fill\": \"String\", \"fill-opacity\": \"Number\"} } ],\"tilestats\": {\"layerCount\": 1,\"layers\": [{\"layer\": \"in\",\"count\": 1024,\"geometry\": \"Polygon\",\"attributeCount\": 6,\"attributes\": [{\"attribute\": \"KPI\",\"count\": 651,\"type\": \"number\",\"values\": [0,1,101,102,107,11,110,111,112,113,114,118,119,120,121,122,123,124,125,126,128,129,13,131,132,134,136,138,139,14,140,141,143,145,146,147,148,149,15,150,152,153,155,156,157,158,16,160,163,165,166,168,17,170,172,174,176,177,178,179,180,181,182,186,187,189,19,191,193,194,196,197,198,199,2,200,201,203,204,205,206,208,209,21,210,211,212,213,216,217,219,220,221,223,224,225,226,227,228,229],\"min\": 0,\"max\": 999},{\"attribute\": \"Lat\",\"count\": 32,\"type\": \"string\",\"values\": [\"0.0000000\",\"0.0018000\",\"0.0036000\",\"0.0054000\",\"0.0072000\",\"0.0090000\",\"0.0108000\",\"0.0126000\",\"0.0144000\",\"0.0162000\",\"0.0180000\",\"0.0198000\",\"0.0216000\",\"0.0234000\",\"0.0252000\",\"0.0270000\",\"0.0288000\",\"0.0306000\",\"0.0324000\",\"0.0342000\",\"0.0360000\",\"0.0378000\",\"0.0396000\",\"0.0414000\",\"0.0432000\",\"0.0450000\",\"0.0468000\",\"0.0486000\",\"0.0504000\",\"0.0522000\",\"0.0540000\",\"0.0558000\"]},{\"attribute\": \"Long\",\"count\": 32,\"type\": \"string\",\"values\": [\"0.0000000\",\"0.0026300\",\"0.0052500\",\"0.0078800\",\"0.0105100\",\"0.0131400\",\"0.0157600\",\"0.0183900\",\"0.0210200\",\"0.0236400\",\"0.0262700\",\"0.0289000\",\"0.0315200\",\"0.0341500\",\"0.0367800\",\"0.0394100\",\"0.0420300\",\"0.0446600\",\"0.0472900\",\"0.0499100\",\"0.0525400\",\"0.0551700\",\"0.0577900\",\"0.0604200\",\"0.0630500\",\"0.0656800\",\"0.0683000\",\"0.0709300\",\"0.0735600\",\"0.0761800\",\"0.0788100\",\"0.0814400\"]},{\"attribute\": \"Tile\",\"count\": 100,\"type\": \"number\",\"values\": [0,1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,32,33,34,35,36,37,38,39,4,40,41,42,43,44,45,46,47,48,49,5,50,51,52,53,54,55,56,57,58,59,6,60,61,62,63,64,65,66,67,68,69,7,70,71,72,73,74,75,76,77,78,79,8,80,81,82,83,84,85,86,87,88,89,9,90,91,92,93,94,95,96,97,98,99],\"min\": 0,\"max\": 99},{\"attribute\": \"fill\",\"count\": 1,\"type\": \"string\",\"values\": [\"#000066\"]},{\"attribute\": \"fill-opacity\",\"count\": 1,\"type\": \"number\",\"values\": [0.5],\"min\": 0.5,\"max\": 0.5}]}]}}",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":11,\"fields\":{\"KPI\":\"Number\",\"Lat\":\"String\",\"Long\":\"String\",\"Tile\":\"Number\",\"fill\":\"String\",\"fill-opacity\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":1024,\"geometry\":\"Polygon\",\"attributeCount\":6,\"attributes\":[{\"attribute\":\"KPI\",\"count\":651,\"type\":\"number\",\"values\":[0,1,101,102,107,11,110,111,112,113,114,118,119,120,121,122,123,124,125,126,128,129,13,131,132,134,136,138,139,14,140,141,143,145,146,147,148,149,15,150,152,153,155,156,157,158,16,160,163,165,166,168,17,170,172,174,176,177,178,179,180,181,182,186,187,189,19,191,193,194,196,197,198,199,2,200,201,203,204,205,206,208,209,21,210,211,212,213,216,217,219,220,221,223,224,225,226,227,228,229],\"min\":0,\"max\":999},{\"attribute\":\"Lat\",\"count\":32,\"type\":\"string\",\"values\":[\"0.0000000\",\"0.0018000\",\"0.0036000\",\"0.0054000\",\"0.0072000\",\"0.0090000\",\"0.0108000\",\"0.0126000\",\"0.0144000\",\"0.0162000\",\"0.0180000\",\"0.0198000\",\"0.0216000\",\"0.0234000\",\"0.0252000\",\"0.0270000\",\"0.0288000\",\"0.0306000\",\"0.0324000\",\"0.0342000\",\"0.0360000\",\"0.0378000\",\"0.0396000\",\"0.0414000\",\"0.0432000\",\"0.0450000\",\"0.0468000\",\"0.0486000\",\"0.0504000\",\"0.0522000\",\"0.0540000\",\"0.0558000\"]},{\"attribute\":\"Long\",\"count\":32,\"type\":\"string\",\"values\":[\"0.0000000\",\"0.0026300\",\"0.0052500\",\"0.0078800\",\"0.0105100\",\"0.0131400\",\"0.0157600\",\"0.0183900\",\"0.0210200\",\"0.0236400\",\"0.0262700\",\"0.0289000\",\"0.0315200\",\"0.0341500\",\"0.0367800\",\"0.0394100\",\"0.0420300\",\"0.0446600\",\"0.0472900\",\"0.0499100\",\"0.0525400\",\"0.0551700\",\"0.0577900\",\"0.0604200\",\"0.0630500\",\"0.0656800\",\"0.0683000\",\"0.0709300\",\"0.0735600\",\"0.0761800\",\"0.0788100\",\"0.0814400\"]},{\"attribute\":\"Tile\",\"count\":100,\"type\":\"number\",\"values\":[0,1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,32,33,34,35,36,37,38,39,4,40,41,42,43,44,45,46,47,48,49,5,50,51,52,53,54,55,56,57,58,59,6,60,61,62,63,64,65,66,67,68,69,7,70,71,72,73,74,75,76,77,78,79,8,80,81,82,83,84,85,86,87,88,89,9,90,91,92,93,94,95,96,97,98,99],\"min\":0,\"max\":99},{\"attribute\":\"fill\",\"count\":1,\"type\":\"string\",\"values\":[\"#000066\"]},{\"attribute\":\"fill-opacity\",\"count\":1,\"type\":\"number\",\"values\":[0.5],\"min\":0.5,\"max\":0.5}]}]}}",
"maxzoom": "11",
"minzoom": "0",
"name": "tests/grid-unaligned/out/-z11_-D7_--grid-low-zooms.json.check.mbtiles",