mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-23 20:35:16 +00:00
Stabilize map center and mbtiles filename to fix test flakiness
This commit is contained in:
parent
7c021035a6
commit
b17f8fc663
6
Makefile
6
Makefile
@ -80,7 +80,7 @@ test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS))
|
||||
prep-test: $(TESTS)
|
||||
|
||||
tests/%.json: Makefile tippecanoe tippecanoe-decode
|
||||
./tippecanoe -f -o $@.mbtiles $(subst _, ,$(patsubst %.json,%,$(word 4,$(subst /, ,$@)))) $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.json)
|
||||
./tippecanoe-decode $@.mbtiles > $@
|
||||
./tippecanoe -f -o $@.check.mbtiles $(subst _, ,$(patsubst %.json,%,$(word 4,$(subst /, ,$@)))) $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.json)
|
||||
./tippecanoe-decode $@.check.mbtiles > $@
|
||||
cmp $(patsubst %.check,%,$@) $@
|
||||
rm $@.mbtiles
|
||||
rm $@.check.mbtiles
|
||||
|
@ -1,12 +1,12 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
||||
"center": "-78.750000,31.461472,4",
|
||||
"description": "tests/ne_110m_admin_1_states_provinces_lines/out/-X_-z4.json.mbtiles",
|
||||
"description": "tests/ne_110m_admin_1_states_provinces_lines/out/-X_-z4.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 4, \"fields\": {} } ] }",
|
||||
"maxzoom": "4",
|
||||
"minzoom": "0",
|
||||
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-X_-z4.json.mbtiles",
|
||||
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-X_-z4.json.check.mbtiles",
|
||||
"type": "overlay",
|
||||
"version": "1"
|
||||
}, "features": [
|
||||
|
@ -1,12 +1,12 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
||||
"center": "-82.968750,37.710240,7",
|
||||
"description": "tests/ne_110m_admin_1_states_provinces_lines/out/-lcountries_-P_-Z1_-z7_-b4_-xfeaturecla_-xscalerank_-acrol_-ps.json.mbtiles",
|
||||
"description": "tests/ne_110m_admin_1_states_provinces_lines/out/-lcountries_-P_-Z1_-z7_-b4_-xfeaturecla_-xscalerank_-acrol_-ps.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"countries\", \"description\": \"\", \"minzoom\": 1, \"maxzoom\": 7, \"fields\": {\"adm0_a3\": \"String\", \"adm0_name\": \"String\", \"mapcolor9\": \"Number\", \"mapcolor13\": \"Number\"} } ] }",
|
||||
"maxzoom": "7",
|
||||
"minzoom": "1",
|
||||
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-lcountries_-P_-Z1_-z7_-b4_-xfeaturecla_-xscalerank_-acrol_-ps.json.mbtiles",
|
||||
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-lcountries_-P_-Z1_-z7_-b4_-xfeaturecla_-xscalerank_-acrol_-ps.json.check.mbtiles",
|
||||
"type": "overlay",
|
||||
"version": "1"
|
||||
}, "features": [
|
||||
|
@ -1,12 +1,12 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
||||
"center": "-84.375000,36.466030,5",
|
||||
"description": "tests/ne_110m_admin_1_states_provinces_lines/out/-z5_-ymapcolor13_-ymapcolor9_-pSi_-d8_-D16.json.mbtiles",
|
||||
"description": "tests/ne_110m_admin_1_states_provinces_lines/out/-z5_-ymapcolor13_-ymapcolor9_-pSi_-d8_-D16.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 5, \"fields\": {\"mapcolor9\": \"Number\", \"mapcolor13\": \"Number\"} } ] }",
|
||||
"maxzoom": "5",
|
||||
"minzoom": "0",
|
||||
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-z5_-ymapcolor13_-ymapcolor9_-pSi_-d8_-D16.json.mbtiles",
|
||||
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-z5_-ymapcolor13_-ymapcolor9_-pSi_-d8_-D16.json.check.mbtiles",
|
||||
"type": "overlay",
|
||||
"version": "1"
|
||||
}, "features": [
|
||||
|
@ -1,12 +1,12 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"bounds": "-1.000000,-1.000000,1.000000,1.000000",
|
||||
"center": "1.000000,-1.000000,4",
|
||||
"description": "tests/nullisland/out/-b0_-z4.json.mbtiles",
|
||||
"center": "-1.000000,1.000000,4",
|
||||
"description": "tests/nullisland/out/-b0_-z4.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 4, \"fields\": {} } ] }",
|
||||
"maxzoom": "4",
|
||||
"minzoom": "0",
|
||||
"name": "tests/nullisland/out/-b0_-z4.json.mbtiles",
|
||||
"name": "tests/nullisland/out/-b0_-z4.json.check.mbtiles",
|
||||
"type": "overlay",
|
||||
"version": "1"
|
||||
}, "features": [
|
||||
|
19
tile.cc
19
tile.cc
@ -1096,10 +1096,21 @@ void *run_thread(void *vargs) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (z == arg->maxzoom && len > *arg->most) {
|
||||
*arg->midx = x;
|
||||
*arg->midy = y;
|
||||
*arg->most = len;
|
||||
if (z == arg->maxzoom) {
|
||||
if (len > *arg->most) {
|
||||
*arg->midx = x;
|
||||
*arg->midy = y;
|
||||
*arg->most = len;
|
||||
} else if (len == *arg->most) {
|
||||
unsigned long long a = (((unsigned long long) x ) << 32) | y;
|
||||
unsigned long long b = (((unsigned long long) *arg->midx) << 32) | *arg->midy;
|
||||
|
||||
if (a < b) {
|
||||
*arg->midx = x;
|
||||
*arg->midy = y;
|
||||
*arg->most = len;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*arg->along += geom - prevgeom;
|
||||
|
Loading…
x
Reference in New Issue
Block a user