mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Don't simplify "unused" movetos from points. Don't write empty geometries.
This commit is contained in:
parent
25e261aa35
commit
cf279940da
@ -1,3 +1,8 @@
|
|||||||
|
## 1.4.2
|
||||||
|
|
||||||
|
* Bug fix for problem that would occasionally produce empty point geometries
|
||||||
|
* More bug fixes for polygon generation
|
||||||
|
|
||||||
## 1.4.1
|
## 1.4.1
|
||||||
|
|
||||||
* Features that cross the antimeridian are split into two parts instead
|
* Features that cross the antimeridian are split into two parts instead
|
||||||
|
@ -108,6 +108,7 @@ drawvec remove_noop(drawvec geom, int type, int shift) {
|
|||||||
|
|
||||||
// second pass: remove unused movetos
|
// second pass: remove unused movetos
|
||||||
|
|
||||||
|
if (type != VT_POINT) {
|
||||||
geom = out;
|
geom = out;
|
||||||
out.resize(0);
|
out.resize(0);
|
||||||
|
|
||||||
@ -130,6 +131,7 @@ drawvec remove_noop(drawvec geom, int type, int shift) {
|
|||||||
|
|
||||||
out.push_back(geom[i]);
|
out.push_back(geom[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// second pass: remove empty movetos
|
// second pass: remove empty movetos
|
||||||
|
|
||||||
|
6
tile.cc
6
tile.cc
@ -753,12 +753,18 @@ long long write_tile(char **geoms, char *metabase, char *stringpool, int z, unsi
|
|||||||
}
|
}
|
||||||
features[j] = out;
|
features[j] = out;
|
||||||
|
|
||||||
|
out.clear();
|
||||||
for (x = 0; x < features[j].size(); x++) {
|
for (x = 0; x < features[j].size(); x++) {
|
||||||
if (features[j][x].coalesced && features[j][x].type == VT_LINE) {
|
if (features[j][x].coalesced && features[j][x].type == VT_LINE) {
|
||||||
features[j][x].geom = remove_noop(features[j][x].geom, features[j][x].type, 0);
|
features[j][x].geom = remove_noop(features[j][x].geom, features[j][x].type, 0);
|
||||||
features[j][x].geom = simplify_lines(features[j][x].geom, 32, 0);
|
features[j][x].geom = simplify_lines(features[j][x].geom, 32, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (features[j][x].geom.size() > 0) {
|
||||||
|
out.push_back(features[j][x]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
features[j] = out;
|
||||||
|
|
||||||
if (prevent['i' & 0xFF]) {
|
if (prevent['i' & 0xFF]) {
|
||||||
std::sort(features[j].begin(), features[j].end(), preservecmp);
|
std::sort(features[j].begin(), features[j].end(), preservecmp);
|
||||||
|
Loading…
Reference in New Issue
Block a user