mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Fix z1 at least
This commit is contained in:
@@ -386,13 +386,13 @@ drawvec clean_or_clip_poly(drawvec &geom, int z, int buffer, bool clip, bool try
|
||||
void to_tile_scale(drawvec &geom, int z, int detail) {
|
||||
if (GLOBAL_DETAIL - detail - z < 0) {
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
geom[i].x = std::round((double) geom[i].x * (1LL << (-(GLOBAL_DETAIL - detail - z))));
|
||||
geom[i].y = std::round((double) geom[i].y * (1LL << (-(GLOBAL_DETAIL - detail - z))));
|
||||
geom[i].x = geom[i].x * (1LL << (-(GLOBAL_DETAIL - detail - z)));
|
||||
geom[i].y = geom[i].y * (1LL << (-(GLOBAL_DETAIL - detail - z)));
|
||||
}
|
||||
} else {
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
geom[i].x = std::round((double) geom[i].x / (1LL << (GLOBAL_DETAIL - detail - z)));
|
||||
geom[i].y = std::round((double) geom[i].y / (1LL << (GLOBAL_DETAIL - detail - z)));
|
||||
geom[i].x = std::llround((double) geom[i].x / (1LL << (GLOBAL_DETAIL - detail - z)));
|
||||
geom[i].y = std::llround((double) geom[i].y / (1LL << (GLOBAL_DETAIL - detail - z)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -415,8 +415,8 @@ drawvec remove_noop(drawvec geom, int type, int shift) {
|
||||
drawvec out;
|
||||
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
long long nx = std::round((double) geom[i].x / (1LL << shift));
|
||||
long long ny = std::round((double) geom[i].y / (1LL << shift));
|
||||
long long nx = std::llround((double) geom[i].x / (1LL << shift));
|
||||
long long ny = std::llround((double) geom[i].y / (1LL << shift));
|
||||
|
||||
if (geom[i].op == VT_LINETO && nx == ox && ny == oy) {
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#include "errors.hpp"
|
||||
#include "projection.hpp"
|
||||
|
||||
drawvec decode_geometry(const char **meta, int z, unsigned tx, unsigned ty, long long *bbox, long long initial_x, long long initial_y) {
|
||||
drawvec decode_geometry(const char **meta, int z, long long tx, long long ty, long long *bbox, long long initial_x, long long initial_y) {
|
||||
drawvec out;
|
||||
|
||||
bbox[0] = LLONG_MAX;
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ struct draw {
|
||||
typedef std::vector<draw> drawvec;
|
||||
struct serial_feature;
|
||||
|
||||
drawvec decode_geometry(const char **meta, int z, unsigned tx, unsigned ty, long long *bbox, long long initial_x, long long initial_y);
|
||||
drawvec decode_geometry(const char **meta, int z, long long tx, long long ty, long long *bbox, long long initial_x, long long initial_y);
|
||||
void to_tile_scale(drawvec &geom, int z, int detail);
|
||||
drawvec from_tile_scale(drawvec const &geom, int z, int detail);
|
||||
drawvec remove_noop(drawvec geom, int type, int shift);
|
||||
|
||||
@@ -447,7 +447,7 @@ static void rewrite(serial_feature const &osf, int z, int nextzoom, int maxzoom,
|
||||
int k;
|
||||
for (k = 0; k < 4; k++) {
|
||||
// Division instead of right-shift because coordinates can be negative
|
||||
bbox2[k] = osf.bbox[k] / (1 << (GLOBAL_DETAIL - nextzoom - 8));
|
||||
bbox2[k] = osf.bbox[k] / (1LL << (GLOBAL_DETAIL - nextzoom - 8));
|
||||
}
|
||||
// Decrement the top and left edges so that any features that are
|
||||
// touching the edge can potentially be included in the adjacent tiles too.
|
||||
|
||||
Reference in New Issue
Block a user