Fix buffering of query box - it was shrinking in the Y axis, rather than growing.
This commit is contained in:
parent
4c6d6aeaa7
commit
af7960a796
@ -36,7 +36,7 @@ const constexpr std::uint32_t VARIANT_TYPE_BOOL = 7;
|
|||||||
|
|
||||||
// Vector tiles are 4096 virtual pixels on each side
|
// Vector tiles are 4096 virtual pixels on each side
|
||||||
const constexpr double EXTENT = 4096.0;
|
const constexpr double EXTENT = 4096.0;
|
||||||
const constexpr double BUFFER = 512.0;
|
const constexpr double BUFFER = 128.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,14 +140,19 @@ inline FloatCoordinate toWGS84(const FloatCoordinate &mercator_coordinate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Converts a WMS tile coordinate (z,x,y) into a wgs bounding box
|
// Converts a WMS tile coordinate (z,x,y) into a wgs bounding box
|
||||||
inline void xyzToWGS84(
|
inline void xyzToWGS84(const int x,
|
||||||
const int x, const int y, const int z, double &minx, double &miny, double &maxx, double &maxy,
|
const int y,
|
||||||
int mercator_buffer = 0)
|
const int z,
|
||||||
|
double &minx,
|
||||||
|
double &miny,
|
||||||
|
double &maxx,
|
||||||
|
double &maxy,
|
||||||
|
int mercator_buffer = 0)
|
||||||
{
|
{
|
||||||
minx = x * TILE_SIZE - mercator_buffer;
|
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;
|
maxx = (x + 1.0) * TILE_SIZE + mercator_buffer;
|
||||||
maxy = y * TILE_SIZE + mercator_buffer;
|
maxy = y * TILE_SIZE - mercator_buffer;
|
||||||
// 2^z * TILE_SIZE
|
// 2^z * TILE_SIZE
|
||||||
const double shift = (1u << static_cast<unsigned>(z)) * TILE_SIZE;
|
const double shift = (1u << static_cast<unsigned>(z)) * TILE_SIZE;
|
||||||
pixelToDegree(shift, minx, miny);
|
pixelToDegree(shift, minx, miny);
|
||||||
|
@ -286,7 +286,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
|||||||
min_lat,
|
min_lat,
|
||||||
max_lon,
|
max_lon,
|
||||||
max_lat,
|
max_lat,
|
||||||
util::web_mercator::TILE_SIZE * 0.05);
|
util::web_mercator::TILE_SIZE * 0.10);
|
||||||
|
|
||||||
util::Coordinate southwest{util::FloatLongitude{min_lon}, util::FloatLatitude{min_lat}};
|
util::Coordinate southwest{util::FloatLongitude{min_lon}, util::FloatLatitude{min_lat}};
|
||||||
util::Coordinate northeast{util::FloatLongitude{max_lon}, util::FloatLatitude{max_lat}};
|
util::Coordinate northeast{util::FloatLongitude{max_lon}, util::FloatLatitude{max_lat}};
|
||||||
|
Loading…
Reference in New Issue
Block a user