Fix buffering of query box - it was shrinking in the Y axis, rather than growing.

This commit is contained in:
Daniel Patterson 2016-11-04 16:57:12 -06:00
parent 4c6d6aeaa7
commit af7960a796
3 changed files with 12 additions and 7 deletions

View File

@ -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;
}
}
}

View File

@ -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<unsigned>(z)) * TILE_SIZE;
pixelToDegree(shift, minx, miny);

View File

@ -286,7 +286,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
min_lat,
max_lon,
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 northeast{util::FloatLongitude{max_lon}, util::FloatLatitude{max_lat}};