FlatCityBuf C++ reader 0.8.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
feature_serializer.hpp File Reference
#include <fcb/generated/feature_generated.h>
#include <fcb/generated/geometry_generated.h>
#include <fcb/generated/header_generated.h>
#include <fcb/packed_rtree.hpp>
#include <fcb/writer/attribute.hpp>
#include <fcb/writer/geom_encoder.hpp>
#include <nlohmann/json.hpp>
#include <array>
#include <optional>
#include <string>

Go to the source code of this file.

Classes

struct  fcb::CoType
 A CityObjectType tag, plus the verbatim CityJSON name when the tag is ExtensionObject (which has no spelling of its own). More...
 
struct  fcb::SurfaceType
 A SemanticSurfaceType tag, plus the verbatim CityJSON name when the tag is ExtraSemanticSurface. More...
 

Namespaces

namespace  fcb
 

Functions

CoType fcb::city_object_type_from_name (const std::string &name)
 Maps a CityJSON CityObject type string to the FlatBuffers tag.
 
SurfaceType fcb::semantic_surface_type_from_name (const std::string &name)
 Maps a CityJSON semantic surface type string to the FlatBuffers tag.
 
::flatbuffers::Offset<::Appearance > fcb::to_appearance (::flatbuffers::FlatBufferBuilder &fbb, const nlohmann::ordered_json &appearance)
 Builds the Appearance table (materials, textures, UV vertices, default themes) from a CityJSON appearance object.
 
::flatbuffers::Offset<::Geometry > fcb::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 – from a CityJSON geometry object (everything but a GeometryInstance, which to_geometry_instance handles).
 
::flatbuffers::Offset<::GeometryInstancefcb::to_geometry_instance (::flatbuffers::FlatBufferBuilder &fbb, const nlohmann::ordered_json &geometry)
 Builds a GeometryInstance table: the template index, the 4x4 transformation matrix, and the single-element boundaries array holding the reference vertex index.
 
::GeographicalExtent fcb::to_geographical_extent (const std::array< double, 6 > &extent)
 Builds a GeographicalExtent struct from a 6-element [minx,miny,minz,maxx,maxy,maxz] array.
 
::flatbuffers::Offset<::CityObject > fcb::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 GeometryInstance entries), attributes (against attr_schema, or the object's own schema when its attribute keys are not all present in attr_schema), children/children-roles/ parents.
 
std::pair<::flatbuffers::Offset<::CityFeature >, NodeItemfcb::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, and optional feature-level appearance – from a CityJSONFeature JSON object, plus its 2D bounding box over the RAW (untransformed, still-integer) vertex coordinates.