mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Stabilize map center and mbtiles filename to fix test flakiness
This commit is contained in:
@@ -80,7 +80,7 @@ test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS))
|
|||||||
prep-test: $(TESTS)
|
prep-test: $(TESTS)
|
||||||
|
|
||||||
tests/%.json: Makefile tippecanoe tippecanoe-decode
|
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 -f -o $@.check.mbtiles $(subst _, ,$(patsubst %.json,%,$(word 4,$(subst /, ,$@)))) $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.json)
|
||||||
./tippecanoe-decode $@.mbtiles > $@
|
./tippecanoe-decode $@.check.mbtiles > $@
|
||||||
cmp $(patsubst %.check,%,$@) $@
|
cmp $(patsubst %.check,%,$@) $@
|
||||||
rm $@.mbtiles
|
rm $@.check.mbtiles
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{ "type": "FeatureCollection", "properties": {
|
{ "type": "FeatureCollection", "properties": {
|
||||||
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
||||||
"center": "-78.750000,31.461472,4",
|
"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",
|
"format": "pbf",
|
||||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 4, \"fields\": {} } ] }",
|
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 4, \"fields\": {} } ] }",
|
||||||
"maxzoom": "4",
|
"maxzoom": "4",
|
||||||
"minzoom": "0",
|
"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",
|
"type": "overlay",
|
||||||
"version": "1"
|
"version": "1"
|
||||||
}, "features": [
|
}, "features": [
|
||||||
|
|||||||
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{ "type": "FeatureCollection", "properties": {
|
{ "type": "FeatureCollection", "properties": {
|
||||||
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
||||||
"center": "-82.968750,37.710240,7",
|
"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",
|
"format": "pbf",
|
||||||
"json": "{\"vector_layers\": [ { \"id\": \"countries\", \"description\": \"\", \"minzoom\": 1, \"maxzoom\": 7, \"fields\": {\"adm0_a3\": \"String\", \"adm0_name\": \"String\", \"mapcolor9\": \"Number\", \"mapcolor13\": \"Number\"} } ] }",
|
"json": "{\"vector_layers\": [ { \"id\": \"countries\", \"description\": \"\", \"minzoom\": 1, \"maxzoom\": 7, \"fields\": {\"adm0_a3\": \"String\", \"adm0_name\": \"String\", \"mapcolor9\": \"Number\", \"mapcolor13\": \"Number\"} } ] }",
|
||||||
"maxzoom": "7",
|
"maxzoom": "7",
|
||||||
"minzoom": "1",
|
"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",
|
"type": "overlay",
|
||||||
"version": "1"
|
"version": "1"
|
||||||
}, "features": [
|
}, "features": [
|
||||||
|
|||||||
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{ "type": "FeatureCollection", "properties": {
|
{ "type": "FeatureCollection", "properties": {
|
||||||
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
"bounds": "-124.213808,29.689480,-70.645734,49.005640",
|
||||||
"center": "-84.375000,36.466030,5",
|
"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",
|
"format": "pbf",
|
||||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 5, \"fields\": {\"mapcolor9\": \"Number\", \"mapcolor13\": \"Number\"} } ] }",
|
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 5, \"fields\": {\"mapcolor9\": \"Number\", \"mapcolor13\": \"Number\"} } ] }",
|
||||||
"maxzoom": "5",
|
"maxzoom": "5",
|
||||||
"minzoom": "0",
|
"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",
|
"type": "overlay",
|
||||||
"version": "1"
|
"version": "1"
|
||||||
}, "features": [
|
}, "features": [
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{ "type": "FeatureCollection", "properties": {
|
{ "type": "FeatureCollection", "properties": {
|
||||||
"bounds": "-1.000000,-1.000000,1.000000,1.000000",
|
"bounds": "-1.000000,-1.000000,1.000000,1.000000",
|
||||||
"center": "1.000000,-1.000000,4",
|
"center": "-1.000000,1.000000,4",
|
||||||
"description": "tests/nullisland/out/-b0_-z4.json.mbtiles",
|
"description": "tests/nullisland/out/-b0_-z4.json.check.mbtiles",
|
||||||
"format": "pbf",
|
"format": "pbf",
|
||||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 4, \"fields\": {} } ] }",
|
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 4, \"fields\": {} } ] }",
|
||||||
"maxzoom": "4",
|
"maxzoom": "4",
|
||||||
"minzoom": "0",
|
"minzoom": "0",
|
||||||
"name": "tests/nullisland/out/-b0_-z4.json.mbtiles",
|
"name": "tests/nullisland/out/-b0_-z4.json.check.mbtiles",
|
||||||
"type": "overlay",
|
"type": "overlay",
|
||||||
"version": "1"
|
"version": "1"
|
||||||
}, "features": [
|
}, "features": [
|
||||||
|
|||||||
@@ -1096,10 +1096,21 @@ void *run_thread(void *vargs) {
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z == arg->maxzoom && len > *arg->most) {
|
if (z == arg->maxzoom) {
|
||||||
*arg->midx = x;
|
if (len > *arg->most) {
|
||||||
*arg->midy = y;
|
*arg->midx = x;
|
||||||
*arg->most = len;
|
*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;
|
*arg->along += geom - prevgeom;
|
||||||
|
|||||||
Reference in New Issue
Block a user