FlatCityBuf C++ reader 0.8.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
attribute.cpp File Reference
#include <fcb/writer/attribute.hpp>
#include <algorithm>
#include <cstring>
#include <limits>
#include <optional>
#include <type_traits>

Go to the source code of this file.

Namespaces

namespace  fcb
 

Functions

void fcb::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 index, in the order attrs's own members appear (see the ordered_json note above) – NOT alphabetically.
 
std::size_t fcb::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 prefix every record also carries.
 
std::vector< std::uint8_t > fcb::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] records, one per schema member present and non-null in attr, in ascending column-index order (NOT attr's own JSON key order).
 
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::Column > > > fcb::to_columns (::flatbuffers::FlatBufferBuilder &fbb, const AttributeSchema &schema)
 Builds the Column vector for Header.columns or CityObject.columns, in ascending column-index order.
 
std::vector< AttributeIndexEntryfcb::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.
 
std::vector< AttributeIndexEntryfcb::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 (not JSON key order, which need not be stable) so that duplicate-key payload ordering in the eventual B+tree is reproducible.
 

Variable Documentation

◆ nanos

std::uint32_t nanos = 0

Definition at line 30 of file attribute.cpp.

Referenced by fcb::KeyValue::from_datetime().

◆ ok

bool ok = false

Definition at line 28 of file attribute.cpp.

Referenced by fcb::FcbReader::select_attr().

◆ seconds

std::int64_t seconds = 0

Definition at line 29 of file attribute.cpp.

Referenced by fcb::KeyValue::from_datetime().