diff --git a/main.cpp b/main.cpp index 5ec0a84cf..f78af971c 100644 --- a/main.cpp +++ b/main.cpp @@ -2832,7 +2832,7 @@ std::pair read_input(std::vector &sources, char *fname, i ai->second.maxzoom = maxzoom; } - metadata m = make_metadata(fname, minzoom, maxzoom, minlat, minlon, maxlat, maxlon, minlat2, minlon2, maxlat2, maxlon2, midlat, midlon, attribution, merged_lm, true, description, !prevent[P_TILE_STATS], attribute_descriptions, "tippecanoe", commandline, strategies); + metadata m = make_metadata(fname, minzoom, maxzoom, minlat, minlon, maxlat, maxlon, minlat2, minlon2, maxlat2, maxlon2, midlat, midlon, attribution, merged_lm, true, description, !prevent[P_TILE_STATS], attribute_descriptions, "tippecanoe", commandline, strategies, basezoom, droprate, retain_points_multiplier); if (outdb != NULL) { mbtiles_write_metadata(outdb, m, forcetable); } else { diff --git a/mbtiles.cpp b/mbtiles.cpp index 3098eecc2..e44cc391f 100644 --- a/mbtiles.cpp +++ b/mbtiles.cpp @@ -601,6 +601,17 @@ void mbtiles_write_metadata(sqlite3 *db, const metadata &m, bool forcetable) { sqlite3_free(sql); } + if (m.decisions_json.size() > 0) { + sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES ('tippecanoe_decisions', %Q);", m.decisions_json.c_str()); + if (sqlite3_exec(db, sql, NULL, NULL, &err) != SQLITE_OK) { + fprintf(stderr, "set decisions: %s\n", err); + if (!forcetable) { + exit(EXIT_SQLITE); + } + } + sqlite3_free(sql); + } + if (m.vector_layers_json.size() > 0 || m.tilestats_json.size() > 0) { std::string json; json_writer state(&json); @@ -642,7 +653,7 @@ void mbtiles_write_metadata(sqlite3 *db, const metadata &m, bool forcetable) { } } -metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map const &layermap, bool vector, const char *description, bool do_tilestats, std::map const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector const &strategies) { +metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map const &layermap, bool vector, const char *description, bool do_tilestats, std::map const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector const &strategies, int basezoom, double droprate, double retain_points_multiplier) { metadata m; m.name = fname; @@ -677,6 +688,14 @@ metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minla m.strategies_json = stringify_strategies(strategies); + if (basezoom != maxzoom || droprate != 2.5 || retain_points_multiplier != 1) { + m.decisions_json = std::string("{") + + "\"basezoom\":" + std::to_string(basezoom) + "," + + "\"droprate\":" + std::to_string(droprate) + "," + + "\"retain_points_multiplier\":" + std::to_string(retain_points_multiplier) + + std::string("}"); + } + if (vector) { { json_writer state(&m.vector_layers_json); diff --git a/mbtiles.hpp b/mbtiles.hpp index 58499da96..f0d0ced64 100644 --- a/mbtiles.hpp +++ b/mbtiles.hpp @@ -66,6 +66,7 @@ struct metadata { std::string vector_layers_json; std::string tilestats_json; + std::string decisions_json; }; #include "tile.hpp" @@ -75,7 +76,7 @@ sqlite3 *mbtiles_open(char *dbname, char **argv, int forcetable); void mbtiles_write_tile(sqlite3 *outdb, int z, int tx, int ty, const char *data, int size); void mbtiles_erase_zoom(sqlite3 *outdb, int z); -metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map const &layermap, bool vector, const char *description, bool do_tilestats, std::map const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector const &strategies); +metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map const &layermap, bool vector, const char *description, bool do_tilestats, std::map const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector const &strategies, int basezoom, double droprate, double retain_points_multiplier); void mbtiles_write_metadata(sqlite3 *db, const metadata &m, bool forcetable); void mbtiles_close(sqlite3 *outdb, const char *pgm); diff --git a/tests/accumulate/out/-z3_-Ethesum%3asum_-Etheproduct%3aproduct_-Ethemax%3amax_-Ethemin%3amin_-Ethemean%3amean_-Etheconcat%3aconcat_-Ethecomma%3acomma_-r1_-K100.json b/tests/accumulate/out/-z3_-Ethesum%3asum_-Etheproduct%3aproduct_-Ethemax%3amax_-Ethemin%3amin_-Ethemean%3amean_-Etheconcat%3aconcat_-Ethecomma%3acomma_-r1_-K100.json index 93bc43b63..20fd176eb 100644 --- a/tests/accumulate/out/-z3_-Ethesum%3asum_-Etheproduct%3aproduct_-Ethemax%3amax_-Ethemin%3amin_-Ethemean%3amean_-Etheconcat%3aconcat_-Ethecomma%3acomma_-r1_-K100.json +++ b/tests/accumulate/out/-z3_-Ethesum%3asum_-Etheproduct%3aproduct_-Ethemax%3amax_-Ethemin%3amin_-Ethemean%3amean_-Etheconcat%3aconcat_-Ethecomma%3acomma_-r1_-K100.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/accumulate/out/-z3_-Ethesum%3asum_-Etheproduct%3aproduct_-Ethemax%3amax_-Ethemin%3amin_-Ethemean%3amean_-Etheconcat%3aconcat_-Ethecomma%3acomma_-r1_-K100.json.check.mbtiles", "strategies": "[{\"coalesced_as_needed\":78},{\"coalesced_as_needed\":65},{\"coalesced_as_needed\":43},{\"coalesced_as_needed\":17}]", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/layer-json/out.mbtiles.json b/tests/layer-json/out.mbtiles.json index ebaecc0d3..89f4a5230 100644 --- a/tests/layer-json/out.mbtiles.json +++ b/tests/layer-json/out.mbtiles.json @@ -8,6 +8,7 @@ "maxzoom": "0", "minzoom": "0", "name": "tests/layer-json/out.mbtiles", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-Z11_-z13_-B15.json b/tests/muni/out/-Z11_-z13_-B15.json index dcb217a4c..5580c571f 100644 --- a/tests/muni/out/-Z11_-z13_-B15.json +++ b/tests/muni/out/-Z11_-z13_-B15.json @@ -10,6 +10,7 @@ "minzoom": "11", "name": "tests/muni/out/-Z11_-z13_-B15.json.check.mbtiles", "strategies": "[{},{},{},{},{},{},{},{},{},{},{},{\"dropped_by_rate\":4727},{\"dropped_by_rate\":4643},{\"dropped_by_rate\":4210}]", +"tippecanoe_decisions": "{\"basezoom\":15,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-Z11_-z13_-Bf2000.json b/tests/muni/out/-Z11_-z13_-Bf2000.json index e2523dd03..169536bb7 100644 --- a/tests/muni/out/-Z11_-z13_-Bf2000.json +++ b/tests/muni/out/-Z11_-z13_-Bf2000.json @@ -10,6 +10,7 @@ "minzoom": "11", "name": "tests/muni/out/-Z11_-z13_-Bf2000.json.check.mbtiles", "strategies": "[{},{},{},{},{},{},{},{},{},{},{},{\"dropped_by_rate\":2910},{},{}]", +"tippecanoe_decisions": "{\"basezoom\":12,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-Z11_-z13_-rf2000.json b/tests/muni/out/-Z11_-z13_-rf2000.json index ee976e9ee..347280ce2 100644 --- a/tests/muni/out/-Z11_-z13_-rf2000.json +++ b/tests/muni/out/-Z11_-z13_-rf2000.json @@ -10,6 +10,7 @@ "minzoom": "11", "name": "tests/muni/out/-Z11_-z13_-rf2000.json.check.mbtiles", "strategies": "[{},{},{},{},{},{},{},{},{},{},{},{\"dropped_by_rate\":2542},{\"dropped_by_rate\":1547},{}]", +"tippecanoe_decisions": "{\"basezoom\":13,\"droprate\":1.451034,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-Z11_-z13_-rf2000_-Bg.json b/tests/muni/out/-Z11_-z13_-rf2000_-Bg.json index 9ba9d2a59..aca27124c 100644 --- a/tests/muni/out/-Z11_-z13_-rf2000_-Bg.json +++ b/tests/muni/out/-Z11_-z13_-rf2000_-Bg.json @@ -10,6 +10,7 @@ "minzoom": "11", "name": "tests/muni/out/-Z11_-z13_-rf2000_-Bg.json.check.mbtiles", "strategies": "[{},{},{},{},{},{},{},{},{},{},{},{\"dropped_by_rate\":2546},{},{}]", +"tippecanoe_decisions": "{\"basezoom\":12,\"droprate\":2.105500,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-Z11_-z13_-rf2000_-g2.json b/tests/muni/out/-Z11_-z13_-rf2000_-g2.json index 3ac0d264e..c01774990 100644 --- a/tests/muni/out/-Z11_-z13_-rf2000_-g2.json +++ b/tests/muni/out/-Z11_-z13_-rf2000_-g2.json @@ -10,6 +10,7 @@ "minzoom": "11", "name": "tests/muni/out/-Z11_-z13_-rf2000_-g2.json.check.mbtiles", "strategies": "[{},{},{},{},{},{},{},{},{},{},{},{\"dropped_by_rate\":1349,\"dropped_by_gamma\":963},{\"dropped_by_rate\":747,\"dropped_by_gamma\":752},{\"dropped_by_gamma\":514}]", +"tippecanoe_decisions": "{\"basezoom\":13,\"droprate\":1.176223,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-r1_-K20.json b/tests/muni/out/-r1_-K20.json index 02c1da51f..f7ad9facc 100644 --- a/tests/muni/out/-r1_-K20.json +++ b/tests/muni/out/-r1_-K20.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/muni/out/-r1_-K20.json.check.mbtiles", "strategies": "[{\"coalesced_as_needed\":4608},{\"coalesced_as_needed\":4608},{\"coalesced_as_needed\":4608},{\"coalesced_as_needed\":4608},{\"coalesced_as_needed\":4608},{\"coalesced_as_needed\":4607},{\"coalesced_as_needed\":4607},{\"coalesced_as_needed\":4606},{\"coalesced_as_needed\":6005},{\"coalesced_as_needed\":5393},{\"coalesced_as_needed\":5012},{\"coalesced_as_needed\":4727},{\"coalesced_as_needed\":4577},{\"coalesced_as_needed\":4003},{\"coalesced_as_needed\":3005}]", +"tippecanoe_decisions": "{\"basezoom\":14,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-z11_--retain-points-multiplier_2_--extend-zooms-if-still-dropping.json b/tests/muni/out/-z11_--retain-points-multiplier_2_--extend-zooms-if-still-dropping.json index 6abb7bb6a..3ecb7a8dc 100644 --- a/tests/muni/out/-z11_--retain-points-multiplier_2_--extend-zooms-if-still-dropping.json +++ b/tests/muni/out/-z11_--retain-points-multiplier_2_--extend-zooms-if-still-dropping.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/muni/out/-z11_--retain-points-multiplier_2_--extend-zooms-if-still-dropping.json.check.mbtiles", "strategies": "[{\"dropped_by_rate\":4609},{\"dropped_by_rate\":4609},{\"dropped_by_rate\":4606},{\"dropped_by_rate\":4603},{\"dropped_by_rate\":4594},{\"dropped_by_rate\":4571},{\"dropped_by_rate\":4514},{\"dropped_by_rate\":4372},{\"dropped_by_rate\":5245},{\"dropped_by_rate\":3681},{\"dropped_by_rate\":1012},{}]", +"tippecanoe_decisions": "{\"basezoom\":11,\"droprate\":2.500000,\"retain_points_multiplier\":2.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/muni/out/-zg_--retain-points-multiplier_2.json b/tests/muni/out/-zg_--retain-points-multiplier_2.json index e31cfaaca..210ca178b 100644 --- a/tests/muni/out/-zg_--retain-points-multiplier_2.json +++ b/tests/muni/out/-zg_--retain-points-multiplier_2.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/muni/out/-zg_--retain-points-multiplier_2.json.check.mbtiles", "strategies": "[{\"dropped_by_rate\":4609},{\"dropped_by_rate\":4609},{\"dropped_by_rate\":4606},{\"dropped_by_rate\":4603},{\"dropped_by_rate\":4594},{\"dropped_by_rate\":4571},{\"dropped_by_rate\":4514},{\"dropped_by_rate\":4372},{\"dropped_by_rate\":5245},{\"dropped_by_rate\":3681},{\"dropped_by_rate\":1012},{}]", +"tippecanoe_decisions": "{\"basezoom\":11,\"droprate\":2.500000,\"retain_points_multiplier\":2.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-densest-as-needed.json b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-densest-as-needed.json index e3e7d8af1..0ef6d42e8 100644 --- a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-densest-as-needed.json +++ b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-densest-as-needed.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-densest-as-needed.json.check.mbtiles", "strategies": "[{\"dropped_as_needed\":168,\"tile_size_desired\":39190},{\"dropped_as_needed\":184,\"tile_size_desired\":25154},{\"dropped_as_needed\":160,\"tiny_polygons\":1,\"tile_size_desired\":21201},{\"dropped_as_needed\":133,\"tile_size_desired\":10758},{\"dropped_as_needed\":58,\"tile_size_desired\":6601},{\"tiny_polygons\":2}]", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-fraction-as-needed.json b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-fraction-as-needed.json index 3f2377cd2..90e344534 100644 --- a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-fraction-as-needed.json +++ b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-fraction-as-needed.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-fraction-as-needed.json.check.mbtiles", "strategies": "[{\"dropped_as_needed\":164,\"tile_size_desired\":39190},{\"dropped_as_needed\":187,\"tile_size_desired\":25154},{\"dropped_as_needed\":190,\"tiny_polygons\":1,\"tile_size_desired\":21201},{\"dropped_as_needed\":181,\"tile_size_desired\":10758},{\"dropped_as_needed\":147,\"tile_size_desired\":6601},{\"tiny_polygons\":2}]", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-smallest-as-needed.json b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-smallest-as-needed.json index cc6fce76c..a15c3b8c2 100644 --- a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-smallest-as-needed.json +++ b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-smallest-as-needed.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-smallest-as-needed.json.check.mbtiles", "strategies": "[{\"dropped_as_needed\":174,\"tile_size_desired\":39190},{\"dropped_as_needed\":200,\"tile_size_desired\":25154},{\"dropped_as_needed\":187,\"tiny_polygons\":1,\"tile_size_desired\":21201},{\"dropped_as_needed\":154,\"tile_size_desired\":10758},{\"dropped_as_needed\":79,\"tile_size_desired\":6601},{\"tiny_polygons\":2}]", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--force-feature-limit.json b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--force-feature-limit.json index 9feaab93e..71bfce66b 100644 --- a/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--force-feature-limit.json +++ b/tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--force-feature-limit.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--force-feature-limit.json.check.mbtiles", "strategies": "[{\"dropped_as_needed\":479,\"tile_size_desired\":39190},{\"dropped_as_needed\":264,\"tiny_polygons\":2,\"tile_size_desired\":25154},{\"dropped_as_needed\":221,\"tiny_polygons\":2,\"tile_size_desired\":21201},{\"dropped_as_needed\":93,\"tile_size_desired\":10758},{\"dropped_as_needed\":9,\"tile_size_desired\":6601},{\"tiny_polygons\":2}]", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_2_-Bf20_-rf20_-pb.json b/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_2_-Bf20_-rf20_-pb.json index b1465ee5e..3666f7a18 100644 --- a/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_2_-Bf20_-rf20_-pb.json +++ b/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_2_-Bf20_-rf20_-pb.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_2_-Bf20_-rf20_-pb.json.check.mbtiles", "strategies": "[{\"dropped_by_rate\":237},{\"dropped_by_rate\":229},{}]", +"tippecanoe_decisions": "{\"basezoom\":2,\"droprate\":6.600000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-Bg.json b/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-Bg.json index 497c82c73..a3635f96f 100644 --- a/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-Bg.json +++ b/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-Bg.json @@ -9,6 +9,7 @@ "maxzoom": "3", "minzoom": "0", "name": "tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-Bg.json.check.mbtiles", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-rp.json b/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-rp.json index c9423aae6..536507116 100644 --- a/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-rp.json +++ b/tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-rp.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/--smallest-maximum-zoom-guess_3_-rp.json.check.mbtiles", "strategies": "[{\"dropped_by_rate\":230},{\"dropped_by_rate\":231},{\"dropped_by_rate\":160},{}]", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":2.658283,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-r1_-z8_-J_tests%2ffeature-filter%2fplaces-filter.json b/tests/ne_110m_populated_places/out/-r1_-z8_-J_tests%2ffeature-filter%2fplaces-filter.json index 07f77c0c1..23557e050 100644 --- a/tests/ne_110m_populated_places/out/-r1_-z8_-J_tests%2ffeature-filter%2fplaces-filter.json +++ b/tests/ne_110m_populated_places/out/-r1_-z8_-J_tests%2ffeature-filter%2fplaces-filter.json @@ -9,6 +9,7 @@ "maxzoom": "8", "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-r1_-z8_-J_tests%2ffeature-filter%2fplaces-filter.json.check.mbtiles", +"tippecanoe_decisions": "{\"basezoom\":8,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-yNAME_-z5_-B3.json b/tests/ne_110m_populated_places/out/-yNAME_-z5_-B3.json index 0dba33944..5750c3b9f 100644 --- a/tests/ne_110m_populated_places/out/-yNAME_-z5_-B3.json +++ b/tests/ne_110m_populated_places/out/-yNAME_-z5_-B3.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-yNAME_-z5_-B3.json.check.mbtiles", "strategies": "[{\"dropped_by_rate\":227},{\"dropped_by_rate\":227},{\"dropped_by_rate\":152},{},{},{}]", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-yNAME_-z5_-r1.5.json b/tests/ne_110m_populated_places/out/-yNAME_-z5_-r1.5.json index b711c0bc5..17bebffb3 100644 --- a/tests/ne_110m_populated_places/out/-yNAME_-z5_-r1.5.json +++ b/tests/ne_110m_populated_places/out/-yNAME_-z5_-r1.5.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-yNAME_-z5_-r1.5.json.check.mbtiles", "strategies": "[{\"dropped_by_rate\":211},{\"dropped_by_rate\":214},{\"dropped_by_rate\":179},{\"dropped_by_rate\":138},{\"dropped_by_rate\":70},{}]", +"tippecanoe_decisions": "{\"basezoom\":5,\"droprate\":1.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-z0_-M10000_--drop-densest-as-needed_--extend-zooms-if-still-dropping-maximum_2.json b/tests/ne_110m_populated_places/out/-z0_-M10000_--drop-densest-as-needed_--extend-zooms-if-still-dropping-maximum_2.json index 67744c62a..0bf23dcd2 100644 --- a/tests/ne_110m_populated_places/out/-z0_-M10000_--drop-densest-as-needed_--extend-zooms-if-still-dropping-maximum_2.json +++ b/tests/ne_110m_populated_places/out/-z0_-M10000_--drop-densest-as-needed_--extend-zooms-if-still-dropping-maximum_2.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-z0_-M10000_--drop-densest-as-needed_--extend-zooms-if-still-dropping-maximum_2.json.check.mbtiles", "strategies": "[{\"dropped_as_needed\":219,\"tile_size_desired\":74691},{\"dropped_as_needed\":207,\"tile_size_desired\":44398},{\"dropped_as_needed\":181,\"tile_size_desired\":35126}]", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-z0_-r1_-yNAME_-ySOV0NAME_-yELEVATION_-YNAME%3aCity_-YSOV0NAME%3aCountry.json b/tests/ne_110m_populated_places/out/-z0_-r1_-yNAME_-ySOV0NAME_-yELEVATION_-YNAME%3aCity_-YSOV0NAME%3aCountry.json index 184960df9..6c2063278 100644 --- a/tests/ne_110m_populated_places/out/-z0_-r1_-yNAME_-ySOV0NAME_-yELEVATION_-YNAME%3aCity_-YSOV0NAME%3aCountry.json +++ b/tests/ne_110m_populated_places/out/-z0_-r1_-yNAME_-ySOV0NAME_-yELEVATION_-YNAME%3aCity_-YSOV0NAME%3aCountry.json @@ -9,6 +9,7 @@ "maxzoom": "0", "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-z0_-r1_-yNAME_-ySOV0NAME_-yELEVATION_-YNAME%3aCity_-YSOV0NAME%3aCountry.json.check.mbtiles", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-z3_-K20_-r1_-yNAME_-k2.json b/tests/ne_110m_populated_places/out/-z3_-K20_-r1_-yNAME_-k2.json index 9de2b89e8..4e90fe343 100644 --- a/tests/ne_110m_populated_places/out/-z3_-K20_-r1_-yNAME_-k2.json +++ b/tests/ne_110m_populated_places/out/-z3_-K20_-r1_-yNAME_-k2.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-z3_-K20_-r1_-yNAME_-k2.json.check.mbtiles", "strategies": "[{\"coalesced_as_needed\":207},{\"coalesced_as_needed\":174},{\"coalesced_as_needed\":108},{}]", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3.json b/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3.json index 92d296f27..a8937ec09 100644 --- a/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3.json +++ b/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3.json @@ -9,6 +9,7 @@ "maxzoom": "3", "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3.json.check.mbtiles", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3_--limit-tile-feature-count-at-maximum-zoom_10.json b/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3_--limit-tile-feature-count-at-maximum-zoom_10.json index b65f0975d..fbe4d54be 100644 --- a/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3_--limit-tile-feature-count-at-maximum-zoom_10.json +++ b/tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3_--limit-tile-feature-count-at-maximum-zoom_10.json @@ -9,6 +9,7 @@ "maxzoom": "3", "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-z3_-r1_--limit-tile-feature-count_3_--limit-tile-feature-count-at-maximum-zoom_10.json.check.mbtiles", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json b/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json index 3e42aa9a5..073248989 100644 --- a/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json +++ b/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json.check.mbtiles", "strategies": "[{\"coalesced_as_needed\":207},{\"coalesced_as_needed\":174},{\"coalesced_as_needed\":108},{\"coalesced_as_needed\":51}]", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME_-kg.json b/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME_-kg.json index c0c54f39e..f409475fc 100644 --- a/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME_-kg.json +++ b/tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME_-kg.json @@ -10,6 +10,7 @@ "minzoom": "0", "name": "tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME_-kg.json.check.mbtiles", "strategies": "[{\"coalesced_as_needed\":207},{\"coalesced_as_needed\":174},{\"coalesced_as_needed\":108},{}]", +"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":1.000000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tests/stable/out/-z3_-B0.json b/tests/stable/out/-z3_-B0.json index 8da34c73d..f0e7076b3 100644 --- a/tests/stable/out/-z3_-B0.json +++ b/tests/stable/out/-z3_-B0.json @@ -9,6 +9,7 @@ "maxzoom": "3", "minzoom": "0", "name": "tests/stable/out/-z3_-B0.json.check.mbtiles", +"tippecanoe_decisions": "{\"basezoom\":0,\"droprate\":2.500000,\"retain_points_multiplier\":1.000000}", "type": "overlay", "version": "2" }, "features": [ diff --git a/tile-join.cpp b/tile-join.cpp index 6e2f93199..9832a4fd9 100644 --- a/tile-join.cpp +++ b/tile-join.cpp @@ -1606,7 +1606,7 @@ int main(int argc, char **argv) { st.maxlon2 = st.maxlon; } - metadata m = make_metadata(name.c_str(), st.minzoom, st.maxzoom, st.minlat, st.minlon, st.maxlat, st.maxlon, st.minlat2, st.minlon2, st.maxlat2, st.maxlon2, st.midlat, st.midlon, attribution.size() != 0 ? attribution.c_str() : NULL, layermap, true, description.c_str(), !pg, attribute_descriptions, "tile-join", generator_options, strategies); + metadata m = make_metadata(name.c_str(), st.minzoom, st.maxzoom, st.minlat, st.minlon, st.maxlat, st.maxlon, st.minlat2, st.minlon2, st.maxlat2, st.maxlon2, st.midlat, st.midlon, attribution.size() != 0 ? attribution.c_str() : NULL, layermap, true, description.c_str(), !pg, attribute_descriptions, "tile-join", generator_options, strategies, st.maxzoom, 2.5, 1); if (outdb != NULL) { mbtiles_write_metadata(outdb, m, true);