From 7338c4b6b06964f1797e6546833e41b41cf7f5eb Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Thu, 19 Dec 2024 16:24:01 -0800 Subject: [PATCH] An empty tileset has empty bounds at null island --- tests/feature-filter/out/filtered.json.standard | 4 ++-- tests/join-population/concat.mbtiles.json | 4 ++-- tile-join.cpp | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/feature-filter/out/filtered.json.standard b/tests/feature-filter/out/filtered.json.standard index 32a6089b..460d6256 100644 --- a/tests/feature-filter/out/filtered.json.standard +++ b/tests/feature-filter/out/filtered.json.standard @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "2147483647.000000,2147483647.000000,-2147483648.000000,-2147483648.000000", -"bounds": "2147483647.000000,2147483647.000000,-2147483648.000000,-2147483648.000000", +"antimeridian_adjusted_bounds": "0.000000,0.000000,0.000000,0.000000", +"bounds": "0.000000,0.000000,0.000000,0.000000", "center": "0.000000,0.000000,0", "description": "tests/feature-filter/out/all.mbtiles", "format": "pbf", diff --git a/tests/join-population/concat.mbtiles.json b/tests/join-population/concat.mbtiles.json index e96d535c..1d18b97a 100644 --- a/tests/join-population/concat.mbtiles.json +++ b/tests/join-population/concat.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "2147483647.000000,2147483647.000000,-2147483648.000000,-2147483648.000000", -"bounds": "2147483647.000000,2147483647.000000,-2147483648.000000,-2147483648.000000", +"antimeridian_adjusted_bounds": "0.000000,0.000000,0.000000,0.000000", +"bounds": "0.000000,0.000000,0.000000,0.000000", "center": "-122.104097,37.695438,0", "description": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "format": "pbf", diff --git a/tile-join.cpp b/tile-join.cpp index a6483ac2..f8c5552e 100644 --- a/tile-join.cpp +++ b/tile-join.cpp @@ -1711,6 +1711,10 @@ int main(int argc, char **argv) { } } + if (st.maxlon < st.minlon) { + st.maxlon = st.minlon = st.maxlat = st.minlat = st.minlon2 = st.maxlon2 = st.minlat2 = st.maxlat2 = 0; + } + if (st.maxlon - st.minlon <= st.maxlon2 - st.minlon2) { st.minlon2 = st.minlon; st.maxlon2 = st.maxlon;