@@ -286,14 +286,19 @@ std::string Building::get_lod() const {
286
286
return m_reconSettings->lod ;
287
287
}
288
288
289
- void Building::get_cityjson_info (nlohmann::json& b ) const {
290
- b [" type" ] = " Building" ;
289
+ void Building::get_cityjson_cityobj_info (nlohmann::json& f ) const {
290
+ f [" type" ] = " Building" ;
291
291
// b["attributes"];
292
292
// get_cityjson_attributes(b, _attributes);
293
293
// float hbase = z_to_float(this->get_height_base());
294
294
// float h = z_to_float(this->get_height());
295
295
// b["attributes"]["TerrainHeight"] = m_baseElevations.back(); // temp - will calculate avg for every footprint
296
- b[" attributes" ][" measuredHeight" ] = m_elevation - geomutils::avg (m_groundElevations[0 ]);
296
+ f[" attributes" ][" measuredHeight" ] = m_elevation - geomutils::avg (m_groundElevations[0 ]);
297
+ }
298
+
299
+ void Building::get_cityjson_geomobj_info (nlohmann::json& g) const {
300
+ g[" type" ] = " MultiSurface" ;
301
+ g[" lod" ] = this ->get_lod ();
297
302
}
298
303
299
304
void Building::get_cityjson_semantics (nlohmann::json& g) const {
@@ -304,22 +309,18 @@ void Building::get_cityjson_semantics(nlohmann::json& g) const {
304
309
} else throw city4cfd_error (" Semantic property map not found!" );
305
310
306
311
std::unordered_map<std::string, int > surfaceId;
307
- surfaceId[" RoofSurface" ] = 0 ; g[" semantics " ][ " surfaces" ][0 ][" type" ] = " RoofSurface" ;
308
- surfaceId[" GroundSurface" ] = 1 ; g[" semantics " ][ " surfaces" ][1 ][" type" ] = " GroundSurface" ;
309
- surfaceId[" WallSurface" ] = 2 ; g[" semantics " ][ " surfaces" ][2 ][" type" ] = " WallSurface" ;
312
+ surfaceId[" RoofSurface" ] = 0 ; g[" surfaces" ][0 ][" type" ] = " RoofSurface" ;
313
+ surfaceId[" GroundSurface" ] = 1 ; g[" surfaces" ][1 ][" type" ] = " GroundSurface" ;
314
+ surfaceId[" WallSurface" ] = 2 ; g[" surfaces" ][2 ][" type" ] = " WallSurface" ;
310
315
311
316
for (auto faceIdx : m_mesh.faces ()) {
312
317
auto it = surfaceId.find (semantics[faceIdx]);
313
318
if (it == surfaceId.end ()) throw city4cfd_error (" Could not find semantic attribute!" );
314
319
315
- g[" semantics " ][ " values" ][faceIdx.idx ()] = it->second ;
320
+ g[" values" ][faceIdx.idx ()] = it->second ;
316
321
}
317
322
}
318
323
319
- std::string Building::get_cityjson_primitive () const {
320
- return " MultiSurface" ;
321
- }
322
-
323
324
TopoClass Building::get_class () const {
324
325
return BUILDING;
325
326
}
0 commit comments