Eradicate more 32s

This commit is contained in:
Erica Fischer
2024-03-14 14:54:54 -07:00
parent a12bea7129
commit 4632b15b47
8 changed files with 82 additions and 78 deletions
+3 -3
View File
@@ -198,7 +198,7 @@ std::vector<mvt_layer> parse_layers(int fd, int z, unsigned x, unsigned y, std::
// Scale and offset geometry from global to tile
for (size_t i = 0; i < dv.size(); i++) {
long long scale = 1LL << (32 - z);
long long scale = 1LL << (GLOBAL_DETAIL - z);
dv[i].x = std::round((dv[i].x - scale * x) * extent / (double) scale);
dv[i].y = std::round((dv[i].y - scale * y) * extent / (double) scale);
}
@@ -385,8 +385,8 @@ serial_feature parse_feature(json_pull *jp, int z, unsigned x, unsigned y, std::
for (size_t i = 0; i < dv.size(); i++) {
unsigned sx = 0, sy = 0;
if (z != 0) {
sx = x << (32 - z);
sy = y << (32 - z);
sx = x << (GLOBAL_DETAIL - z);
sy = y << (GLOBAL_DETAIL - z);
}
dv[i].x = std::round(dv[i].x / scale) * scale - sx;
dv[i].y = std::round(dv[i].y / scale) * scale - sy;