mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Fix neglected --accumulate-attribute when binning
This commit is contained in:
@@ -583,7 +583,7 @@ accumulate-test:
|
|||||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep 'clustered:sum:POP1950' | sed 's/.*"clustered:sum:POP1950": //' | awk '{sum += $$1} END {print sum}'` == 161590
|
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep 'clustered:sum:POP1950' | sed 's/.*"clustered:sum:POP1950": //' | awk '{sum += $$1} END {print sum}'` == 161590
|
||||||
# which is the right global total
|
# which is the right global total
|
||||||
# the cluster sizes still add up to the 243 original features
|
# the cluster sizes still add up to the 243 original features
|
||||||
test `./tippecanoe-decode -c tests/pbf/accum-0-0-0.pbf 0 0 0 | sed 's/.*clustered:cluster_size": //' | awk '{sum += $$1} END {print sum}'` == 243
|
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | sed 's/.*clustered:cluster_size": //' | awk '{sum += $$1} END {print sum}'` == 243
|
||||||
|
|
||||||
join-filter-test: tippecanoe tippecanoe-decode tile-join
|
join-filter-test: tippecanoe tippecanoe-decode tile-join
|
||||||
# Comes out different from the direct tippecanoe run because null attributes are lost
|
# Comes out different from the direct tippecanoe run because null attributes are lost
|
||||||
|
|||||||
@@ -1437,6 +1437,7 @@ static bool bbox_intersects(long long x1min, long long y1min, long long x1max, l
|
|||||||
}
|
}
|
||||||
|
|
||||||
mvt_tile assign_to_bins(mvt_tile const &features, std::vector<mvt_layer> const &bins, int z, int x, int y, int detail,
|
mvt_tile assign_to_bins(mvt_tile const &features, std::vector<mvt_layer> const &bins, int z, int x, int y, int detail,
|
||||||
|
std::unordered_map<std::string, attribute_op> const &attribute_accum,
|
||||||
std::string const &accumulate_numeric) {
|
std::string const &accumulate_numeric) {
|
||||||
std::vector<index_event> events;
|
std::vector<index_event> events;
|
||||||
|
|
||||||
@@ -1531,8 +1532,6 @@ mvt_tile assign_to_bins(mvt_tile const &features, std::vector<mvt_layer> const &
|
|||||||
} else /* EXIT */ {
|
} else /* EXIT */ {
|
||||||
auto const &found = active.find({e.layer, e.feature});
|
auto const &found = active.find({e.layer, e.feature});
|
||||||
if (found != active.end()) {
|
if (found != active.end()) {
|
||||||
std::unordered_map<std::string, attribute_op> attribute_accum;
|
|
||||||
|
|
||||||
if (outfeatures[found->outfeature].size() > 1) {
|
if (outfeatures[found->outfeature].size() > 1) {
|
||||||
feature_out(outfeatures[found->outfeature], outlayer,
|
feature_out(outfeatures[found->outfeature], outlayer,
|
||||||
std::set<std::string>(), attribute_accum,
|
std::set<std::string>(), attribute_accum,
|
||||||
@@ -1797,7 +1796,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bins.size() > 0) {
|
if (bins.size() > 0) {
|
||||||
outtile = assign_to_bins(outtile, bins, nz, nx, ny, detail, accumulate_numeric);
|
outtile = assign_to_bins(outtile, bins, nz, nx, ny, detail, attribute_accum, accumulate_numeric);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ssize_t i = outtile.layers.size() - 1; i >= 0; i--) {
|
for (ssize_t i = outtile.layers.size() - 1; i >= 0; i--) {
|
||||||
|
|||||||
Reference in New Issue
Block a user