Fix retrieval of forward/reverse data.

This commit is contained in:
Daniel Patterson
2016-10-18 07:34:02 -06:00
parent ef2261661c
commit 4c6d6aeaa7
3 changed files with 69 additions and 22 deletions
+1 -1
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 = 128.0;
const constexpr double BUFFER = 512.0;
}
}
}
+6 -5
View File
@@ -141,12 +141,13 @@ 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)
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;
miny = (y + 1.0) * TILE_SIZE;
maxx = (x + 1.0) * TILE_SIZE;
maxy = y * TILE_SIZE;
minx = x * 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;
// 2^z * TILE_SIZE
const double shift = (1u << static_cast<unsigned>(z)) * TILE_SIZE;
pixelToDegree(shift, minx, miny);