Skip to content

Commit

Permalink
fix issue with reconstruct app
Browse files Browse the repository at this point in the history
  • Loading branch information
Ylannl committed Nov 26, 2024
1 parent f15a7ab commit 029665d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions apps/roofer-app/crop_tile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ bool crop_tile(const roofer::TBox<double>& tile,
roofer::AttributeVecMap attributes;
vector_reader->readPolygons(footprints, &attributes);

if (!pj->data_offset.has_value()) {
logger.error("No data offset set after reading inputs");
const unsigned N_fp = footprints.size();
if (N_fp == 0) {
return false;
}

const unsigned N_fp = footprints.size();
if (N_fp == 0) {
if (!pj->data_offset.has_value()) {
logger.error("No data offset set after reading inputs");
return false;
}

Expand Down
5 changes: 4 additions & 1 deletion src/extra/io/CityJsonWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ namespace roofer::io {
auto semantic_objects = nlohmann::json::array();
std::vector<int> sem_values;
for (size_t i = 0; i < mesh.get_polygons().size(); ++i) {
auto semantic_object = attributes2json(mesh.get_attributes().at(i));
nlohmann::json::object_t semantic_object;
if (mesh.get_attributes().size()) {
semantic_object = attributes2json(mesh.get_attributes().at(i));
}
if (mesh.get_labels()[i] == 0) {
semantic_object["type"] = "GroundSurface";
} else if (mesh.get_labels()[i] == 1) {
Expand Down

0 comments on commit 029665d

Please sign in to comment.