Limit guessed maxzoom to avoid spending too many tiles on polygon fill (#23)

* Change sqlite3 schema to deduplicate identical tiles

* Limit guessed maxzoom to avoid spending too many tiles on polygon fill

* Fix test.

These dust polygons now have their area calculated because their
maxzoom is being guessed, so the attributes from the largest one
rather than the last one are preserved.

* Increase polygon limit to a million tiles

* Two million tiles ought to be enough for anyone, right?

* Add explanatory comments for mysterious numbers
This commit is contained in:
Erica Fischer
2022-11-07 10:14:17 -08:00
committed by GitHub
parent 1584543224
commit 622084a507
7 changed files with 130 additions and 30 deletions
+5 -1
View File
@@ -539,7 +539,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
}
double extent = 0;
if (additional[A_DROP_SMALLEST_AS_NEEDED] || additional[A_COALESCE_SMALLEST_AS_NEEDED] || order_by_size) {
if (additional[A_DROP_SMALLEST_AS_NEEDED] || additional[A_COALESCE_SMALLEST_AS_NEEDED] || order_by_size || sst->want_dist) {
if (sf.t == VT_POLYGON) {
for (size_t i = 0; i < scaled_geometry.size(); i++) {
if (scaled_geometry[i].op == VT_MOVETO) {
@@ -576,6 +576,10 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
sf.extent = LLONG_MAX;
}
if (sst->want_dist && sf.t == VT_POLYGON) {
*(sst->area_sum) += extent;
}
if (!prevent[P_INPUT_ORDER]) {
sf.seq = 0;
}