mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-03 00:45:41 +02:00
Trying to figure out what is throwing off this point's location
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "text.hpp"
|
||||
#include "sort.hpp"
|
||||
#include "tile-cache.hpp"
|
||||
#include "projection.hpp"
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
|
||||
@@ -105,3 +106,19 @@ TEST_CASE("Bit reversal", "bit reversal") {
|
||||
REQUIRE(bit_reverse(0x1234567812489BCF) == 0xF3D912481E6A2C48);
|
||||
REQUIRE(bit_reverse(0xF3D912481E6A2C48) == 0x1234567812489BCF);
|
||||
}
|
||||
|
||||
TEST_CASE("Projection", "projection") {
|
||||
// troublesome point from tests/accumulate/in.json
|
||||
long long wx36, wy36;
|
||||
lonlat2tile(-123.948513, -81.873970, 36, &wx36, &wy36);
|
||||
REQUIRE(wx36 == 0x27dbdc9fb);
|
||||
REQUIRE(wy36 == 0xebc06c629);
|
||||
|
||||
long long wx32, wy32;
|
||||
lonlat2tile(-123.948513, -81.873970, 32, &wx32, &wy32);
|
||||
REQUIRE(wx32 == 0x27dbdca0);
|
||||
REQUIRE(wy32 == 0xebc06c63);
|
||||
|
||||
REQUIRE(std::llround(wx36 / 16.0) == wx32);
|
||||
REQUIRE(std::llround(wy36 / 16.0) == wy32);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user