mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Revert "Serialize and deserialize the distance with the vertices"
This reverts commit 753f1b7909.
This commit is contained in:
+8
-11
@@ -40,11 +40,9 @@ drawvec decode_geometry(const char **meta, int z, unsigned tx, unsigned ty, long
|
||||
|
||||
if (d.op == VT_MOVETO || d.op == VT_LINETO) {
|
||||
long long dx, dy;
|
||||
signed char necessary;
|
||||
|
||||
deserialize_long_long(meta, &dx);
|
||||
deserialize_long_long(meta, &dy);
|
||||
deserialize_byte(meta, &necessary);
|
||||
|
||||
wx += dx * (1 << geometry_scale);
|
||||
wy += dy * (1 << geometry_scale);
|
||||
@@ -64,7 +62,6 @@ drawvec decode_geometry(const char **meta, int z, unsigned tx, unsigned ty, long
|
||||
|
||||
d.x = wwx;
|
||||
d.y = wwy;
|
||||
d.necessary = necessary;
|
||||
}
|
||||
|
||||
out.push_back(d);
|
||||
@@ -227,11 +224,11 @@ drawvec impose_tile_boundaries(const drawvec &geom, long long extent) {
|
||||
if (c > 1) { // clipped
|
||||
if (x1 != geom[i - 1].x || y1 != geom[i - 1].y) {
|
||||
out.emplace_back(VT_LINETO, x1, y1);
|
||||
out[out.size() - 1].necessary = 127;
|
||||
out[out.size() - 1].necessary = 1;
|
||||
}
|
||||
if (x2 != geom[i - 0].x || y2 != geom[i - 0].y) {
|
||||
out.emplace_back(VT_LINETO, x2, y2);
|
||||
out[out.size() - 1].necessary = 127;
|
||||
out[out.size() - 1].necessary = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,13 +245,13 @@ drawvec simplify_lines(drawvec &geom, int z, int tx, int ty, int detail, bool ma
|
||||
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
if (geom[i].op == VT_MOVETO) {
|
||||
geom[i].necessary = 127;
|
||||
geom[i].necessary = 1;
|
||||
} else if (geom[i].op == VT_LINETO) {
|
||||
geom[i].necessary = 0;
|
||||
// if this is actually the endpoint, not an intermediate point,
|
||||
// it will be marked as necessary below
|
||||
} else {
|
||||
geom[i].necessary = 127;
|
||||
geom[i].necessary = 1;
|
||||
}
|
||||
|
||||
if (prevent[P_SIMPLIFY_SHARED_NODES]) {
|
||||
@@ -268,7 +265,7 @@ drawvec simplify_lines(drawvec &geom, int z, int tx, int ty, int detail, bool ma
|
||||
|
||||
auto pt = std::lower_bound(shared_nodes.begin(), shared_nodes.end(), geom[i]);
|
||||
if (pt != shared_nodes.end() && *pt == geom[i]) {
|
||||
geom[i].necessary = 127;
|
||||
geom[i].necessary = true;
|
||||
}
|
||||
|
||||
if (nodepos > 0) {
|
||||
@@ -284,7 +281,7 @@ drawvec simplify_lines(drawvec &geom, int z, int tx, int ty, int detail, bool ma
|
||||
n.index = encode_quadkey((unsigned) d.x, (unsigned) d.y);
|
||||
|
||||
if (bsearch(&n, shared_nodes_map, nodepos / sizeof(node), sizeof(node), nodecmp) != NULL) {
|
||||
geom[i].necessary = 127;
|
||||
geom[i].necessary = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -303,8 +300,8 @@ drawvec simplify_lines(drawvec &geom, int z, int tx, int ty, int detail, bool ma
|
||||
}
|
||||
}
|
||||
|
||||
geom[i].necessary = 127;
|
||||
geom[j - 1].necessary = 127;
|
||||
geom[i].necessary = 1;
|
||||
geom[j - 1].necessary = 1;
|
||||
|
||||
// empirical mapping from douglas-peucker simplifications
|
||||
// to visvalingam simplifications that yield similar
|
||||
|
||||
Reference in New Issue
Block a user