20const char*
const kCityObjectTypeNames[] = {
24 "BridgeConstructiveElement",
29 "BuildingInstallation",
30 "BuildingConstructiveElement",
41 "SolitaryVegetationObject",
50 "TunnelConstructiveElement",
55constexpr std::size_t kCityObjectTypeCount =
56 sizeof(kCityObjectTypeNames) /
sizeof(kCityObjectTypeNames[0]);
58const char*
const kSemanticSurfaceTypeNames[] = {
59 "RoofSurface",
"GroundSurface",
"WallSurface",
"ClosureSurface",
60 "OuterCeilingSurface",
"OuterFloorSurface",
"Window",
"Door",
61 "InteriorWallSurface",
"CeilingSurface",
"FloorSurface",
"WaterSurface",
62 "WaterGroundSurface",
"WaterClosureSurface",
"TrafficArea",
"AuxiliaryTrafficArea",
63 "TransportationMarking",
"TransportationHole",
65constexpr std::size_t kSemanticSurfaceTypeCount =
66 sizeof(kSemanticSurfaceTypeNames) /
sizeof(kSemanticSurfaceTypeNames[0]);
68std::optional<::flatbuffers::Offset<::flatbuffers::Vector<double>>>
69to_color(::flatbuffers::FlatBufferBuilder& fbb,
const nlohmann::ordered_json& obj,
71 auto it = obj.find(key);
72 if (it == obj.end() || it->is_null())
74 std::vector<double> v;
75 for (
const auto& c : *it)
76 v.push_back(c.get<
double>());
77 return fbb.CreateVector(v);
86::flatbuffers::Offset<::SemanticObject>
87to_semantic_object(::flatbuffers::FlatBufferBuilder& fbb,
const nlohmann::ordered_json& surface,
89 auto [type_, extension_type_name] =
98 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<std::uint32_t>>> children;
99 if (
auto it = surface.find(
"children"); it != surface.end() && it->is_array()) {
100 std::vector<std::uint32_t> c;
101 for (
const auto& v : *it)
102 c.push_back(v.get<std::uint32_t>());
103 children = fbb.CreateVector(c);
106 auto extension_type =
107 extension_type_name ? std::optional(fbb.CreateString(*extension_type_name)) : std::nullopt;
109 ::flatbuffers::Optional<std::uint32_t> parent = ::flatbuffers::nullopt;
110 if (
auto it = surface.find(
"parent"); it != surface.end() && !it->is_null())
111 parent = it->get<std::uint32_t>();
113 nlohmann::ordered_json other = nlohmann::ordered_json::object();
114 for (
const auto& [key, val] : surface.items())
115 if (key !=
"type" && key !=
"parent" && key !=
"children")
118 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<std::uint8_t>>> attributes;
119 if (!other.empty() && semantic_attr_schema !=
nullptr) {
123 return CreateSemanticObject(fbb, type_, attributes.value_or(0), children.value_or(0), parent,
124 extension_type.value_or(0));
130 for (std::size_t i = 0; i < kCityObjectTypeCount; ++i) {
131 if (name == kCityObjectTypeNames[i])
132 return {
static_cast<::CityObjectType
>(i), std::nullopt};
134 return {::CityObjectType::ExtensionObject, name};
138 for (std::size_t i = 0; i < kSemanticSurfaceTypeCount; ++i) {
139 if (name == kSemanticSurfaceTypeNames[i])
140 return {
static_cast<::SemanticSurfaceType
>(i), std::nullopt};
142 return {::SemanticSurfaceType::ExtraSemanticSurface, name};
145::flatbuffers::Offset<::Appearance>
to_appearance(::flatbuffers::FlatBufferBuilder& fbb,
146 const nlohmann::ordered_json& appearance) {
147 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Material>>>>
149 if (
auto it = appearance.find(
"materials"); it != appearance.end() && it->is_array()) {
150 std::vector<::flatbuffers::Offset<::Material>> materials;
151 for (
const auto& m : *it) {
159 auto name = fbb.CreateString(m.at(
"name").get<std::string>());
160 auto diffuse_color = to_color(fbb, m,
"diffuseColor");
161 auto emissive_color = to_color(fbb, m,
"emissiveColor");
162 auto specular_color = to_color(fbb, m,
"specularColor");
164 auto ambient = m.find(
"ambientIntensity");
165 auto shininess = m.find(
"shininess");
166 auto transparency = m.find(
"transparency");
167 auto is_smooth = m.find(
"isSmooth");
168 materials.push_back(CreateMaterial(
170 ambient != m.end() && !ambient->is_null()
171 ? ::flatbuffers::Optional<double>(ambient->get<
double>())
172 : ::flatbuffers::nullopt,
173 diffuse_color.value_or(0), emissive_color.value_or(0), specular_color.value_or(0),
174 shininess != m.end() && !shininess->is_null()
175 ? ::flatbuffers::Optional<double>(shininess->get<
double>())
176 : ::flatbuffers::nullopt,
177 transparency != m.end() && !transparency->is_null()
178 ? ::flatbuffers::Optional<double>(transparency->get<
double>())
179 : ::flatbuffers::nullopt,
180 is_smooth != m.end() && !is_smooth->is_null()
181 ? ::flatbuffers::Optional<bool>(is_smooth->get<
bool>())
182 : ::flatbuffers::nullopt));
184 materials_off = fbb.CreateVector(materials);
187 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Texture>>>>
189 if (
auto it = appearance.find(
"textures"); it != appearance.end() && it->is_array()) {
190 std::vector<::flatbuffers::Offset<::Texture>> textures;
191 for (
const auto& t : *it) {
194 auto type_it = t.find(
"type");
195 const ::TextureFormat format = (type_it != t.end() && *type_it ==
"JPG")
196 ? ::TextureFormat::JPG
197 : ::TextureFormat::PNG;
198 auto image = fbb.CreateString(t.value(
"image", std::string()));
200 ::flatbuffers::Optional<::WrapMode> wrap_mode = ::flatbuffers::nullopt;
201 if (
auto w = t.find(
"wrapMode"); w != t.end() && !w->is_null()) {
202 const std::string& s = w->get_ref<
const std::string&>();
204 wrap_mode = ::WrapMode::None;
205 else if (s ==
"wrap")
206 wrap_mode = ::WrapMode::Wrap;
207 else if (s ==
"mirror")
208 wrap_mode = ::WrapMode::Mirror;
209 else if (s ==
"clamp")
210 wrap_mode = ::WrapMode::Clamp;
211 else if (s ==
"border")
212 wrap_mode = ::WrapMode::Border;
215 ::flatbuffers::Optional<::TextureType> texture_type = ::flatbuffers::nullopt;
216 if (
auto tt = t.find(
"textureType"); tt != t.end() && !tt->is_null()) {
217 const std::string& s = tt->get_ref<
const std::string&>();
219 texture_type = ::TextureType::Unknown;
220 else if (s ==
"specific")
221 texture_type = ::TextureType::Specific;
222 else if (s ==
"typical")
223 texture_type = ::TextureType::Typical;
230 auto border_color = to_color(fbb, t,
"borderColor");
231 textures.push_back(CreateTexture(fbb, format, image, wrap_mode, texture_type,
232 border_color.value_or(0)));
234 textures_off = fbb.CreateVector(textures);
237 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<const ::Vec2*>>> vertices_texture_off;
238 if (
auto it = appearance.find(
"vertices-texture"); it != appearance.end() && it->is_array()) {
239 std::vector<::Vec2> uvs;
240 for (
const auto& v : *it)
241 uvs.push_back(::Vec2(v.at(0).get<
double>(), v.at(1).get<
double>()));
242 vertices_texture_off = fbb.CreateVectorOfStructs(uvs);
245 std::optional<::flatbuffers::Offset<::flatbuffers::String>> default_theme_texture_off;
246 if (
auto it = appearance.find(
"default-theme-texture");
247 it != appearance.end() && it->is_string())
248 default_theme_texture_off = fbb.CreateString(it->get<std::string>());
250 std::optional<::flatbuffers::Offset<::flatbuffers::String>> default_theme_material_off;
251 if (
auto it = appearance.find(
"default-theme-material");
252 it != appearance.end() && it->is_string())
253 default_theme_material_off = fbb.CreateString(it->get<std::string>());
255 return CreateAppearance(fbb, materials_off.value_or(0), textures_off.value_or(0),
256 vertices_texture_off.value_or(0), default_theme_texture_off.value_or(0),
257 default_theme_material_off.value_or(0));
260::flatbuffers::Offset<::Geometry>
to_geometry(::flatbuffers::FlatBufferBuilder& fbb,
261 const nlohmann::ordered_json& geometry,
264 const auto type_ =
static_cast<::GeometryType
>(kind);
265 auto lod = geometry.find(
"lod");
266 auto lod_off = (lod != geometry.end() && lod->is_string())
267 ? std::optional(fbb.CreateString(lod->get<std::string>()))
277 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<std::uint32_t>>> semantics_values_off;
279 ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::SemanticObject>>>>
280 semantics_objects_off;
282 std::vector<::flatbuffers::Offset<::SemanticObject>> objects;
283 for (
const auto& surface : encoded.
semantics->surfaces)
284 objects.push_back(to_semantic_object(fbb, surface, semantic_attr_schema));
285 semantics_objects_off = fbb.CreateVector(objects);
287 semantics_values_off = fbb.CreateVector(*encoded.
semantics->values);
291 ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::MaterialMapping>>>>
294 std::vector<::flatbuffers::Offset<::MaterialMapping>> mappings;
295 for (
const auto& m : *encoded.
materials) {
296 auto theme = fbb.CreateString(m.theme);
299 mappings.push_back(CreateMaterialMapping(
300 fbb, theme, 0, 0, 0, ::flatbuffers::Optional<std::uint32_t>(m.value)));
311 auto solids = fbb.CreateVector(m.solids);
312 auto shells = fbb.CreateVector(m.shells);
313 auto vertices = fbb.CreateVector(m.vertices);
314 mappings.push_back(CreateMaterialMapping(fbb, theme, solids, shells, vertices,
315 ::flatbuffers::nullopt));
320 CreateMaterialMapping(fbb, theme, 0, 0, 0, ::flatbuffers::nullopt));
324 material_off = fbb.CreateVector(mappings);
328 ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::TextureMapping>>>>
331 std::vector<::flatbuffers::Offset<::TextureMapping>> mappings;
332 for (
const auto& t : *encoded.
textures) {
333 auto theme = fbb.CreateString(t.theme);
340 auto solids = fbb.CreateVector(t.solids);
341 auto shells = fbb.CreateVector(t.shells);
342 auto surfaces = fbb.CreateVector(t.surfaces);
343 auto strings = fbb.CreateVector(t.strings);
344 auto vertices = fbb.CreateVector(t.vertices);
346 CreateTextureMapping(fbb, theme, solids, shells, surfaces, strings, vertices));
348 mappings.push_back(CreateTextureMapping(fbb, theme, 0, 0, 0, 0, 0));
351 texture_off = fbb.CreateVector(mappings);
354 return CreateGeometry(fbb, type_, lod_off.value_or(0), solids_off, shells_off, surfaces_off,
355 strings_off, boundaries_off, semantics_values_off.value_or(0),
356 semantics_objects_off.value_or(0), material_off.value_or(0),
357 texture_off.value_or(0));
360::flatbuffers::Offset<::GeometryInstance>
362 const nlohmann::ordered_json& geometry) {
363 if (geometry.at(
"type").get<std::string>() !=
"GeometryInstance") {
365 "to_geometry_instance called on a non-GeometryInstance geometry");
368 const std::uint32_t template_ = geometry.at(
"template").get<std::uint32_t>();
370 std::vector<std::uint32_t> indices;
371 for (
const auto& v : geometry.at(
"boundaries"))
372 indices.push_back(v.get<std::uint32_t>());
373 auto boundaries_off = fbb.CreateVector(indices);
375 const auto& m = geometry.at(
"transformationMatrix");
376 ::TransformationMatrix matrix(
377 m.at(0).get<
double>(), m.at(1).get<
double>(), m.at(2).get<
double>(), m.at(3).get<
double>(),
378 m.at(4).get<
double>(), m.at(5).get<
double>(), m.at(6).get<
double>(), m.at(7).get<
double>(),
379 m.at(8).get<
double>(), m.at(9).get<
double>(), m.at(10).get<
double>(),
380 m.at(11).get<
double>(), m.at(12).get<
double>(), m.at(13).get<
double>(),
381 m.at(14).get<
double>(), m.at(15).get<
double>());
383 return CreateGeometryInstance(fbb, &matrix, template_, boundaries_off);
387 return ::GeographicalExtent(::Vector(extent[0], extent[1], extent[2]),
388 ::Vector(extent[3], extent[4], extent[5]));
396std::int32_t to_vertex_coordinate(
const nlohmann::ordered_json& c) {
397 const auto v = c.get<std::int64_t>();
398 if (v < std::numeric_limits<std::int32_t>::min() ||
399 v > std::numeric_limits<std::int32_t>::max())
401 "vertex coordinate " + std::to_string(v) +
402 " is outside the 32-bit range of a FlatCityBuf Vertex");
403 return static_cast<std::int32_t
>(v);
410 ::flatbuffers::Offset<::flatbuffers::Vector<std::uint8_t>> attr_offset;
411 std::optional<AttributeSchema> own_schema;
414FcbAttribute to_fcb_attribute(::flatbuffers::FlatBufferBuilder& fbb,
416 bool is_own_schema =
false;
417 for (
const auto& [key, val] : attr.items()) {
418 if (schema.find(key) == schema.end()) {
419 is_own_schema =
true;
427 return {fbb.CreateVector(encoded), std::move(own_schema)};
430 return {fbb.CreateVector(encoded), std::nullopt};
435::flatbuffers::Offset<::Address>
to_address(::flatbuffers::FlatBufferBuilder& fbb,
436 const nlohmann::ordered_json& address) {
437 if (!address.is_object())
441 std::optional<::flatbuffers::Offset<::Geometry>> location_off;
442 nlohmann::ordered_json other = nlohmann::ordered_json::object();
443 for (
const auto& [key, val] : address.items()) {
444 if (key ==
"location")
452 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<std::uint8_t>>> attributes_off;
453 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Column>>>>
455 if (!other.empty()) {
459 attributes_off = fbb.CreateVector(encoded);
462 return CreateAddress(fbb, attributes_off.value_or(0), columns_off.value_or(0),
463 location_off.value_or(0));
466::flatbuffers::Offset<::CityObject>
to_city_object(::flatbuffers::FlatBufferBuilder& fbb,
467 const std::string&
id,
468 const nlohmann::ordered_json& co,
471 auto id_off = fbb.CreateString(
id);
472 auto [type_, extension_type_name] =
474 auto extension_type_off =
475 extension_type_name ? std::optional(fbb.CreateString(*extension_type_name)) : std::nullopt;
477 std::optional<::GeographicalExtent> extent;
478 if (
auto it = co.find(
"geographicalExtent");
479 it != co.end() && it->is_array() && it->size() == 6) {
481 it->at(2).get<
double>(), it->at(3).get<
double>(),
482 it->at(4).get<
double>(), it->at(5).get<
double>()});
485 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Geometry>>>>
488 ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::GeometryInstance>>>>
489 geometry_instances_off;
490 if (
auto git = co.find(
"geometry"); git != co.end() && git->is_array()) {
510 std::vector<::flatbuffers::Offset<::Geometry>> geoms;
511 for (
const auto& g : *git)
512 if (g.at(
"type").get<std::string>() !=
"GeometryInstance")
513 geoms.push_back(
to_geometry(fbb, g, semantic_attr_schema));
514 geometry_off = fbb.CreateVector(geoms);
516 std::vector<::flatbuffers::Offset<::GeometryInstance>> instances;
517 for (
const auto& g : *git)
518 if (g.at(
"type").get<std::string>() ==
"GeometryInstance")
524 geometry_instances_off = fbb.CreateVector(instances);
527 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<std::uint8_t>>> attributes_off;
528 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Column>>>>
530 if (
auto ait = co.find(
"attributes"); ait != co.end() && ait->is_object()) {
531 FcbAttribute fcb_attr = to_fcb_attribute(fbb, *ait, attr_schema);
532 attributes_off = fcb_attr.attr_offset;
533 if (fcb_attr.own_schema)
534 columns_off =
to_columns(fbb, *fcb_attr.own_schema);
538 ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>>>
540 if (
auto it = co.find(
"children"); it != co.end() && it->is_array()) {
541 std::vector<::flatbuffers::Offset<::flatbuffers::String>> c;
542 for (
const auto& s : *it)
543 c.push_back(fbb.CreateString(s.get<std::string>()));
544 children_off = fbb.CreateVector(c);
556 ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>>>
558 if (
auto it = co.find(
"children_roles"); it != co.end() && it->is_array()) {
559 std::vector<::flatbuffers::Offset<::flatbuffers::String>> r;
560 for (
const auto& role : *it)
562 fbb.CreateString(role.is_string() ? role.get<std::string>() : std::string()));
563 children_roles_off = fbb.CreateVector(r);
567 ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>>>
569 if (
auto it = co.find(
"parents"); it != co.end() && it->is_array()) {
570 std::vector<::flatbuffers::Offset<::flatbuffers::String>> p;
571 for (
const auto& s : *it)
572 p.push_back(fbb.CreateString(s.get<std::string>()));
573 parents_off = fbb.CreateVector(p);
577 std::optional<::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Address>>>>
579 if (
auto it = co.find(
"address"); it != co.end() && it->is_array()) {
580 std::vector<::flatbuffers::Offset<::Address>> a;
581 for (
const auto& entry : *it)
583 address_off = fbb.CreateVector(a);
586 return CreateCityObject(
587 fbb, type_, extension_type_off.value_or(0), id_off, extent ? &*extent :
nullptr,
588 geometry_off.value_or(0), geometry_instances_off.value_or(0), attributes_off.value_or(0),
589 columns_off.value_or(0), children_off.value_or(0), children_roles_off.value_or(0),
590 parents_off.value_or(0), address_off.value_or(0));
593std::pair<::flatbuffers::Offset<::CityFeature>, NodeItem>
595 const nlohmann::ordered_json& city_feature,
const AttributeSchema& attr_schema,
597 auto id_off = fbb.CreateString(
id);
602 static const nlohmann::ordered_json kEmptyObjects = nlohmann::ordered_json::object();
603 auto co_it = city_feature.find(
"CityObjects");
604 const nlohmann::ordered_json& city_objects =
605 (co_it != city_feature.end() && co_it->is_object()) ? *co_it : kEmptyObjects;
607 std::vector<std::string> object_ids;
608 object_ids.reserve(city_objects.size());
609 for (
const auto& [oid, unused] : city_objects.items())
610 object_ids.push_back(oid);
611 std::sort(object_ids.begin(), object_ids.end());
613 std::vector<::flatbuffers::Offset<::CityObject>> objects;
614 objects.reserve(object_ids.size());
615 for (
const auto& oid : object_ids)
617 to_city_object(fbb, oid, city_objects.at(oid), attr_schema, semantic_attr_schema));
618 auto objects_off = fbb.CreateVector(objects);
620 std::vector<::Vertex> fb_vertices;
621 double min_x = 0, min_y = 0, max_x = 0, max_y = 0;
623 if (
auto it = city_feature.find(
"vertices"); it != city_feature.end()) {
624 fb_vertices.reserve(it->size());
625 for (
const auto& v : *it) {
626 const double x = v.at(0).get<
double>();
627 const double y = v.at(1).get<
double>();
628 fb_vertices.emplace_back(to_vertex_coordinate(v.at(0)), to_vertex_coordinate(v.at(1)),
629 to_vertex_coordinate(v.at(2)));
635 min_x = std::min(min_x, x);
636 max_x = std::max(max_x, x);
637 min_y = std::min(min_y, y);
638 max_y = std::max(max_y, y);
642 auto vertices_off = fbb.CreateVectorOfStructs(fb_vertices);
644 std::optional<::flatbuffers::Offset<::Appearance>> appearance_off;
645 if (
auto it = city_feature.find(
"appearance"); it != city_feature.end() && it->is_object())
648 NodeItem bbox{min_x, min_y, max_x, max_y, 0};
650 CreateCityFeature(fbb, id_off, objects_off, vertices_off, appearance_off.value_or(0));
651 return {feature_off, bbox};
Every failure the library reports is one of these.
GeometryKind geometry_kind_from_name(const std::string &name)
Maps a CityJSON geometry type string to GeometryKind.
std::vector< std::uint8_t > encode_attributes_with_schema(const nlohmann::ordered_json &attr, const AttributeSchema &schema)
Encodes attr (a CityJSON attributes object) against schema: repeated [u16 LE column index][value] rec...
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Column > > > to_columns(::flatbuffers::FlatBufferBuilder &fbb, const AttributeSchema &schema, std::optional< std::uint16_t > id_column=std::nullopt)
Builds the Column vector for Header.columns or CityObject.columns, in ascending column-index order.
std::map< std::string, std::pair< std::uint16_t, ::ColumnType > > AttributeSchema
Attribute schema: name -> (column index, column type).
::flatbuffers::Offset<::CityObject > to_city_object(::flatbuffers::FlatBufferBuilder &fbb, const std::string &id, const nlohmann::ordered_json &co, const AttributeSchema &attr_schema, const AttributeSchema *semantic_attr_schema)
Builds one CityObject table: type, geographical extent, geometry (split into non-instance and Geometr...
EncodedGeometry encode(const nlohmann::ordered_json &geometry)
Flattens one CityJSON geometry object – its boundaries and whatever semantics, material and texture i...
::flatbuffers::Offset<::GeometryInstance > to_geometry_instance(::flatbuffers::FlatBufferBuilder &fbb, const nlohmann::ordered_json &geometry)
Builds a GeometryInstance table: the template index, the 4x4 transformation matrix,...
::flatbuffers::Offset<::Address > to_address(::flatbuffers::FlatBufferBuilder &fbb, const nlohmann::ordered_json &address)
Builds one Address table from one entry of a CityJSON address array: location as a MultiPoint Geometr...
GeometryKind
The FlatBuffers GeometryType enumerators, mirrored here so a caller can name a geometry type without ...
void add_attributes(AttributeSchema &schema, const nlohmann::ordered_json &attrs)
Adds every member of a JSON object to schema, assigning each new, non-null name the next free column ...
CoType city_object_type_from_name(const std::string &name)
Maps a CityJSON CityObject type string to the FlatBuffers tag.
::flatbuffers::Offset<::Appearance > to_appearance(::flatbuffers::FlatBufferBuilder &fbb, const nlohmann::ordered_json &appearance)
Builds the Appearance table (materials, textures, UV vertices, default themes) from a CityJSON appear...
::flatbuffers::Offset<::Geometry > to_geometry(::flatbuffers::FlatBufferBuilder &fbb, const nlohmann::ordered_json &geometry, const AttributeSchema *semantic_attr_schema)
Builds one Geometry table – boundaries, and whatever semantics, material and texture it carries – fro...
::GeographicalExtent to_geographical_extent(const std::array< double, 6 > &extent)
Builds a GeographicalExtent struct from a 6-element [minx,miny,minz,maxx,maxy,maxz] array.
std::pair<::flatbuffers::Offset<::CityFeature >, NodeItem > to_fcb_city_feature(::flatbuffers::FlatBufferBuilder &fbb, const std::string &id, const nlohmann::ordered_json &city_feature, const AttributeSchema &attr_schema, const AttributeSchema *semantic_attr_schema)
Builds one CityFeature table – its CityObjects (visited in ascending id order), vertices,...
SurfaceType semantic_surface_type_from_name(const std::string &name)
Maps a CityJSON semantic surface type string to the FlatBuffers tag.
A CityObjectType tag, plus the verbatim CityJSON name when the tag is ExtensionObject (which has no s...
Everything one CityJSON geometry object flattens to.
std::optional< std::vector< TextureMapping > > textures
std::optional< GMSemantics > semantics
std::optional< std::vector< MaterialMapping > > materials
std::vector< std::uint32_t > strings
std::vector< std::uint32_t > shells
std::vector< std::uint32_t > solids
std::vector< std::uint32_t > surfaces
std::vector< std::uint32_t > indices
One R-tree node entry: 4 doubles then a u64, all little-endian, 40 bytes with no padding (packed_rtre...
A SemanticSurfaceType tag, plus the verbatim CityJSON name when the tag is ExtraSemanticSurface.