Skip to content

Commit

Permalink
An empty tileset has empty bounds at null island
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Dec 20, 2024
1 parent acffe23 commit 7338c4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/feature-filter/out/filtered.json.standard
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/join-population/concat.mbtiles.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions tile-join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7338c4b

Please sign in to comment.