mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Fix layer list in tilestats when filtering and tile-joining.
(The feature count when filtering will be the sum of features across tiles instead of filters from the original input, since the filter reader doesn't know what the original input feature set was.)
This commit is contained in:
+28
-26
@@ -200,36 +200,38 @@ int serialize_geometry(json_object *geometry, json_object *properties, json_obje
|
||||
|
||||
long long bbox[] = {LLONG_MAX, LLONG_MAX, LLONG_MIN, LLONG_MIN};
|
||||
|
||||
if (tippecanoe_layername.size() != 0) {
|
||||
if (layermap->count(tippecanoe_layername) == 0) {
|
||||
layermap->insert(std::pair<std::string, layermap_entry>(tippecanoe_layername, layermap_entry(layermap->size())));
|
||||
}
|
||||
if (!filters) {
|
||||
if (tippecanoe_layername.size() != 0) {
|
||||
if (layermap->count(tippecanoe_layername) == 0) {
|
||||
layermap->insert(std::pair<std::string, layermap_entry>(tippecanoe_layername, layermap_entry(layermap->size())));
|
||||
}
|
||||
|
||||
auto ai = layermap->find(tippecanoe_layername);
|
||||
if (ai != layermap->end()) {
|
||||
layer = ai->second.id;
|
||||
layername = tippecanoe_layername;
|
||||
auto ai = layermap->find(tippecanoe_layername);
|
||||
if (ai != layermap->end()) {
|
||||
layer = ai->second.id;
|
||||
layername = tippecanoe_layername;
|
||||
|
||||
if (mb_geometry[t] == VT_POINT) {
|
||||
ai->second.points++;
|
||||
} else if (mb_geometry[t] == VT_LINE) {
|
||||
ai->second.lines++;
|
||||
} else if (mb_geometry[t] == VT_POLYGON) {
|
||||
ai->second.polygons++;
|
||||
if (mb_geometry[t] == VT_POINT) {
|
||||
ai->second.points++;
|
||||
} else if (mb_geometry[t] == VT_LINE) {
|
||||
ai->second.lines++;
|
||||
} else if (mb_geometry[t] == VT_POLYGON) {
|
||||
ai->second.polygons++;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Internal error: can't find layer name %s\n", tippecanoe_layername.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Internal error: can't find layer name %s\n", tippecanoe_layername.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
auto fk = layermap->find(layername);
|
||||
if (fk != layermap->end()) {
|
||||
if (mb_geometry[t] == VT_POINT) {
|
||||
fk->second.points++;
|
||||
} else if (mb_geometry[t] == VT_LINE) {
|
||||
fk->second.lines++;
|
||||
} else if (mb_geometry[t] == VT_POLYGON) {
|
||||
fk->second.polygons++;
|
||||
auto fk = layermap->find(layername);
|
||||
if (fk != layermap->end()) {
|
||||
if (mb_geometry[t] == VT_POINT) {
|
||||
fk->second.points++;
|
||||
} else if (mb_geometry[t] == VT_LINE) {
|
||||
fk->second.lines++;
|
||||
} else if (mb_geometry[t] == VT_POLYGON) {
|
||||
fk->second.polygons++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user