Skip to content

Commit 5bafdbb

Browse files
committed
fix issue when building_class!=6
1 parent 34e2f53 commit 5bafdbb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/extra/io/StreamCropper.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ namespace roofer::io {
166166
if (poly_grids[poly_i]->test(point)) {
167167
if (point_class == ground_class) {
168168
point_cloud.push_back(point);
169-
(*classification).push_back(2);
169+
(*classification).push_back(ground_class);
170170
} else if (point_class == building_class) {
171171
poly_intersect.push_back(poly_i);
172172
}
@@ -189,7 +189,7 @@ namespace roofer::io {
189189
auto classification =
190190
point_cloud.attributes.get_if<int>("classification");
191191
point_cloud.push_back(point);
192-
(*classification).push_back(6);
192+
(*classification).push_back(building_class);
193193
}
194194
}
195195
}
@@ -237,10 +237,10 @@ namespace roofer::io {
237237
size_t pt_cnt_grd = 0;
238238
float z_sum = 0;
239239
for (size_t pi = 0; pi < point_cloud.size(); ++pi) {
240-
if ((*classification)[pi] == 6) {
240+
if ((*classification)[pi] == building_class) {
241241
++pt_cnt_bld;
242242
z_sum += point_cloud[pi][2];
243-
} else if ((*classification)[pi] == 2) {
243+
} else if ((*classification)[pi] == ground_class) {
244244
++pt_cnt_grd;
245245
}
246246
}
@@ -260,7 +260,7 @@ namespace roofer::io {
260260
point_cloud.attributes.get_if<int>("classification");
261261
for (auto& p : ground_buffer_points[poly_i]) {
262262
point_cloud.push_back(p);
263-
(*classification).push_back(2);
263+
(*classification).push_back(ground_class);
264264
}
265265
}
266266
ground_buffer_points.clear();
@@ -305,7 +305,7 @@ namespace roofer::io {
305305
auto classification =
306306
point_cloud.attributes.get_if<int>("classification");
307307
point_cloud.push_back(*p);
308-
(*classification).push_back(6);
308+
(*classification).push_back(building_class);
309309
poly_info[polylist.back()].pt_count_bld++;
310310
}
311311
}

0 commit comments

Comments
 (0)