5# include <fcb/generated/header_generated.h>
8# include <nlohmann/json.hpp>
16# include <flatbuffers/flatbuffers.h>
42using AttributeSchema = std::map<std::string, std::pair<std::uint16_t, ::ColumnType>>;
54std::size_t
attr_size(::ColumnType coltype,
const nlohmann::ordered_json& colval);
67::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Column>>>
86std::vector<AttributeIndexEntry>
88 const std::vector<std::string>& indexing_attr);
95std::vector<AttributeIndexEntry>
98 const std::vector<std::string>& indexing_attr);
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...
std::size_t attr_size(::ColumnType coltype, const nlohmann::ordered_json &colval)
Byte width one value of coltype occupies in the attribute blob, EXCLUDING the 2-byte column-index pre...
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Column > > > to_columns(::flatbuffers::FlatBufferBuilder &fbb, const AttributeSchema &schema)
Builds the Column vector for Header.columns or CityObject.columns, in ascending column-index order.
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 ...
std::vector< AttributeIndexEntry > cityfeature_to_index_entries(const nlohmann::ordered_json &city_feature, const AttributeSchema &schema, const std::vector< std::string > &indexing_attr)
Same, over every object in one CityJSONFeature's CityObjects, visited in ascending object-id order (n...
std::map< std::string, std::pair< std::uint16_t, ::ColumnType > > AttributeSchema
Attribute schema: name -> (column index, column type).
std::vector< AttributeIndexEntry > attribute_to_index_entries(const nlohmann::ordered_json &attr, const AttributeSchema &schema, const std::vector< std::string > &indexing_attr)
Extracts index entries for indexing_attr from one CityJSON attributes object.
One indexable (column, value) pair pulled out of a feature for the static B+tree builder (M6).