From 043b35eeded5bd0902f443136655dfe2fc3da08d Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Sat, 18 Oct 2014 11:40:09 -0700 Subject: [PATCH] Take another opportunity to simplify lines after coalescing features --- tile.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tile.cc b/tile.cc index b7ec341c..56277979 100644 --- a/tile.cc +++ b/tile.cc @@ -662,6 +662,7 @@ struct coalesce { std::vector meta; unsigned long long index; char *metasrc; + bool coalesced; bool operator< (const coalesce &o) const { int cmp = coalindexcmp(this, &o); @@ -952,6 +953,7 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns c.index = i->index; c.geom = geom; c.metasrc = meta; + c.coalesced = false; decode_meta(&meta, &keys, &values, file_keys, &c.meta, NULL); features.push_back(c); @@ -974,12 +976,20 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns for (z = 0; z < features[x].geom.size(); z++) { out[y].geom.push_back(features[x].geom[z]); } + out[y].coalesced = true; } else { out.push_back(features[x]); } } features = out; + for (x = 0; x < features.size(); x++) { + if (features[x].coalesced && features[x].type == VT_LINE) { + features[x].geom = remove_noop(features[x].geom, features[x].type); + features[x].geom = simplify_lines(features[x].geom, 32, 0); + } + } + mapnik::vector::tile tile = create_tile(layername, line_detail, features, &count, &keys, &values); pool_free(&keys);