Don't coalesce features that have different IDs.

Remove the 700-point limit on coalesced features, since
polygon merging is no longer a performance problem.
This commit is contained in:
Eric Fischer
2017-12-13 12:05:53 -08:00
parent 82a2b5dfdc
commit 2e32004589
7 changed files with 560 additions and 79 deletions
+14 -1
View File
@@ -116,6 +116,19 @@ int coalcmp(const void *v1, const void *v2) {
return cmp;
}
if (c1->has_id != c2->has_id) {
return (int) c1->has_id - (int) c2->has_id;
}
if (c1->has_id && c2->has_id) {
if (c1->id < c2->id) {
return -1;
}
if (c1->id > c2->id) {
return 1;
}
}
return metacmp(c1->m, c1->keys, c1->values, c1->stringpool, c2->m, c2->keys, c2->values, c2->stringpool);
}
@@ -1765,7 +1778,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
}
#endif
if (additional[A_COALESCE] && out.size() > 0 && out[y].geom.size() + layer_features[x].geom.size() < 700 && coalcmp(&layer_features[x], &out[y]) == 0 && layer_features[x].type != VT_POINT) {
if (additional[A_COALESCE] && out.size() > 0 && coalcmp(&layer_features[x], &out[y]) == 0 && layer_features[x].type != VT_POINT) {
for (size_t g = 0; g < layer_features[x].geom.size(); g++) {
out[y].geom.push_back(layer_features[x].geom[g]);
}