diff --git a/include/util/vector_tile.hpp b/include/util/vector_tile.hpp index 26a3e42ac..f3c05791e 100644 --- a/include/util/vector_tile.hpp +++ b/include/util/vector_tile.hpp @@ -36,7 +36,7 @@ const constexpr std::uint32_t VARIANT_TYPE_BOOL = 7; // Vector tiles are 4096 virtual pixels on each side const constexpr double EXTENT = 4096.0; -const constexpr double BUFFER = 512.0; +const constexpr double BUFFER = 128.0; } } } diff --git a/include/util/web_mercator.hpp b/include/util/web_mercator.hpp index 6fc8dea8e..1bc4b1ca4 100644 --- a/include/util/web_mercator.hpp +++ b/include/util/web_mercator.hpp @@ -140,14 +140,19 @@ inline FloatCoordinate toWGS84(const FloatCoordinate &mercator_coordinate) } // Converts a WMS tile coordinate (z,x,y) into a wgs bounding box -inline void xyzToWGS84( - const int x, const int y, const int z, double &minx, double &miny, double &maxx, double &maxy, - int mercator_buffer = 0) +inline void xyzToWGS84(const int x, + const int y, + const int z, + double &minx, + double &miny, + double &maxx, + double &maxy, + int mercator_buffer = 0) { minx = x * TILE_SIZE - mercator_buffer; - miny = (y + 1.0) * TILE_SIZE - mercator_buffer; + miny = (y + 1.0) * TILE_SIZE + mercator_buffer; maxx = (x + 1.0) * TILE_SIZE + mercator_buffer; - maxy = y * TILE_SIZE + mercator_buffer; + maxy = y * TILE_SIZE - mercator_buffer; // 2^z * TILE_SIZE const double shift = (1u << static_cast(z)) * TILE_SIZE; pixelToDegree(shift, minx, miny); diff --git a/src/engine/plugins/tile.cpp b/src/engine/plugins/tile.cpp index e8198f031..053930bff 100644 --- a/src/engine/plugins/tile.cpp +++ b/src/engine/plugins/tile.cpp @@ -286,7 +286,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr