From accdb96409c339d4281c27abff45dfeeaffdd800 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Thu, 14 Mar 2024 23:40:56 -0700 Subject: [PATCH] Trying to fix tileset bounding boxes --- main.cpp | 4 ++-- serial.hpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index e5871083..24c44ad4 100644 --- a/main.cpp +++ b/main.cpp @@ -3823,8 +3823,8 @@ int main(int argc, char **argv) { long long file_bbox[4] = {UINT_MAX, UINT_MAX, 0, 0}; - long long file_bbox1[4] = {0xFFFFFFFF, 0xFFFFFFFF, 0, 0}; // standard -180 to 180 world plane - long long file_bbox2[4] = {0x1FFFFFFFF, 0xFFFFFFFF, 0x100000000, 0}; // 0 to 360 world plane + long long file_bbox1[4] = {(1LL << GLOBAL_DETAIL) - 1, (1LL << GLOBAL_DETAIL) - 1, 0, 0}; // standard -180 to 180 world plane + long long file_bbox2[4] = {(2LL << GLOBAL_DETAIL) - 1, (1LL << GLOBAL_DETAIL) - 1, 1LL << GLOBAL_DETAIL, 0}; // 0 to 360 world plane auto input_ret = read_input(sources, name ? name : out_mbtiles ? out_mbtiles : out_dir, diff --git a/serial.hpp b/serial.hpp index c2eaf768..2e8ed3d5 100644 --- a/serial.hpp +++ b/serial.hpp @@ -10,6 +10,7 @@ #include "geometry.hpp" #include "mbtiles.hpp" #include "jsonpull/jsonpull.h" +#include "projection.hpp" size_t fwrite_check(const void *ptr, size_t size, size_t nitems, FILE *stream, std::atomic *fpos, const char *fname); @@ -143,8 +144,8 @@ struct reader { std::atomic nodepos; long long file_bbox[4] = {0, 0, 0, 0}; - long long file_bbox1[4] = {0xFFFFFFFF, 0xFFFFFFFF, 0, 0}; // standard -180 to 180 world plane - long long file_bbox2[4] = {0x1FFFFFFFF, 0xFFFFFFFF, 0x100000000, 0}; // 0 to 360 world plane + long long file_bbox1[4] = {(1LL << GLOBAL_DETAIL) - 1, (1LL << GLOBAL_DETAIL) - 1, 0, 0}; // standard -180 to 180 world plane + long long file_bbox2[4] = {(2LL << GLOBAL_DETAIL) - 1, (1LL << GLOBAL_DETAIL) - 1, 1LL << GLOBAL_DETAIL, 0}; // 0 to 360 world plane struct stat geomst {}; char *geom_map = NULL;