@@ -1405,10 +1405,6 @@ void add_tilestats(std::string const &layername, int z, std::vector<std::map<std
1405
1405
}
1406
1406
1407
1407
void promote_attribute (std::string const &key, serial_feature &p, key_pool &key_pool) {
1408
- if (p.need_tilestats .count (key) == 0 ) {
1409
- p.need_tilestats .insert (key);
1410
- }
1411
-
1412
1408
// If the feature being merged into has this key as a metadata reference,
1413
1409
// promote it to a full_key so it can be modified
1414
1410
@@ -1430,10 +1426,6 @@ void promote_attribute(std::string const &key, serial_feature &p, key_pool &key_
1430
1426
}
1431
1427
1432
1428
void promote_attribute_prefix (std::string const &key, std::string const &prefixed_key, serial_feature &p, key_pool &key_pool) {
1433
- if (p.need_tilestats .count (prefixed_key) == 0 ) {
1434
- p.need_tilestats .insert (prefixed_key);
1435
- }
1436
-
1437
1429
// does the prefixed attribute already exist as a full key?
1438
1430
ssize_t found_as = -1 ;
1439
1431
for (size_t i = 0 ; i < p.full_keys .size (); i++) {
@@ -1450,6 +1442,7 @@ void promote_attribute_prefix(std::string const &key, std::string const &prefixe
1450
1442
if (found_as >= 0 ) {
1451
1443
p.full_keys .push_back (key_pool.pool (prefixed_key));
1452
1444
p.full_values .push_back (p.full_values [found_as]);
1445
+
1453
1446
return ;
1454
1447
}
1455
1448
@@ -2300,8 +2293,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
2300
2293
std::vector<std::shared_ptr<serial_feature>> &features = kv.second .features ;
2301
2294
2302
2295
if (retain_points_multiplier > 1 ) {
2303
- add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, " tippecanoe:retain_points_multiplier_first" , serial_val (mvt_bool, " true" ));
2304
-
2305
2296
// mapping from input sequence to current sequence within this tile
2306
2297
std::vector<std::pair<size_t , size_t >> feature_sequences;
2307
2298
@@ -2322,8 +2313,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
2322
2313
2323
2314
features[j]->full_keys .push_back (key_pool.pool (" tippecanoe:retain_points_multiplier_sequence" ));
2324
2315
features[j]->full_values .push_back (sv);
2325
-
2326
- add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, *features[j]->full_keys .back (), sv);
2327
2316
}
2328
2317
}
2329
2318
@@ -2340,22 +2329,16 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
2340
2329
sv.s = " true" ;
2341
2330
p.full_values .push_back (sv);
2342
2331
2343
- add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, " clustered" , sv);
2344
-
2345
2332
p.full_keys .push_back (key_pool.pool (" point_count" ));
2346
2333
sv2.type = mvt_double;
2347
2334
sv2.s = std::to_string (point_count);
2348
2335
p.full_values .push_back (sv2);
2349
2336
2350
- add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, " point_count" , sv2);
2351
-
2352
2337
p.full_keys .push_back (key_pool.pool (" sqrt_point_count" ));
2353
2338
sv3.type = mvt_double;
2354
2339
sv3.s = std::to_string (round (100 * sqrt (point_count)) / 100.0 );
2355
2340
p.full_values .push_back (sv3);
2356
2341
2357
- add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, " sqrt_point_count" , sv3);
2358
-
2359
2342
p.full_keys .push_back (key_pool.pool (" point_count_abbreviated" ));
2360
2343
sv4.type = mvt_string;
2361
2344
if (point_count >= 10000 ) {
@@ -2367,21 +2350,15 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
2367
2350
}
2368
2351
sv4.s = abbrev;
2369
2352
p.full_values .push_back (sv4);
2370
-
2371
- add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, " point_count_abbreviated" , sv4);
2372
2353
}
2373
2354
2374
- if (p.need_tilestats .size () > 0 ) {
2375
- for (size_t j = 0 ; j < p.full_keys .size (); j++) {
2376
- if (p.need_tilestats .count (*p.full_keys [j]) > 0 ) {
2377
- // remove accumulation state
2378
- size_t found = p.full_values [j].s .find (' \0 ' );
2379
- if (found != std::string::npos) {
2380
- p.full_values [j].s = p.full_values [j].s .substr (0 , found);
2381
- }
2382
- add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, *p.full_keys [j], p.full_values [j]);
2383
- }
2355
+ for (size_t j = 0 ; j < p.full_keys .size (); j++) {
2356
+ // remove accumulation state
2357
+ size_t found = p.full_values [j].s .find (' \0 ' );
2358
+ if (found != std::string::npos) {
2359
+ p.full_values [j].s = p.full_values [j].s .substr (0 , found);
2384
2360
}
2361
+ add_tilestats (layername, z, layermaps, tiling_seg, layer_unmaps, *p.full_keys [j], p.full_values [j]);
2385
2362
}
2386
2363
}
2387
2364
@@ -2574,6 +2551,9 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
2574
2551
layer.tag (feature, *layer_features[x]->full_keys [a], v);
2575
2552
}
2576
2553
2554
+ layer_features[x]->full_keys .clear ();
2555
+ layer_features[x]->full_values .clear ();
2556
+
2577
2557
if (additional[A_CALCULATE_FEATURE_DENSITY]) {
2578
2558
int glow = 255 ;
2579
2559
if (layer_features[x]->spacing > 0 ) {
0 commit comments