10# include <nlohmann/json.hpp>
81 std::optional<AttributeSchema> semantic_attr_schema);
92 void add_feature(
const nlohmann::ordered_json& city_json_feature);
105 void write(std::ostream& out);
111 std::vector<std::uint8_t>
write();
119 nlohmann::ordered_json cj_;
122 std::optional<AttributeSchema> semantic_attr_schema_;
123 std::vector<std::string> indexing_attr_;
140 std::FILE* tmp_ =
nullptr;
141 std::uint64_t tmp_write_pos_ = 0;
142 bool written_ =
false;
144 std::vector<FeatureSlot> feat_offsets_;
145 std::vector<NodeItem> feat_nodes_;
146 std::vector<std::vector<AttributeIndexEntry>> index_entries_by_feature_;
Streaming writer for one .fcb file, mirroring Rust's own FcbWriter (writer/mod.rs) shape: each add_fe...
void add_feature(const nlohmann::ordered_json &city_json_feature)
Encodes and spools one CityJSONFeature line.
std::vector< std::uint8_t > write()
Convenience wrapper around write(std::ostream&) that returns the complete file as one buffer.
FcbWriter & operator=(const FcbWriter &)=delete
FcbWriter(const FcbWriter &)=delete
FcbWriter(FcbWriter &&)=delete
FcbWriter & operator=(FcbWriter &&)=delete
constexpr std::uint16_t kDefaultNodeSize
std::map< std::string, std::pair< std::uint16_t, ::ColumnType > > AttributeSchema
Attribute schema: name -> (column index, column type).
Configuration for FcbWriter.
bool write_index
false forces index_node_size to 0 in the written header (no R-tree at all), regardless of index_node_...
std::uint16_t index_node_size
std::vector< std::pair< std::string, std::optional< std::uint16_t > > > attribute_indices
(attribute name, branching factor); std::nullopt branching factor means build_static_btree's own defa...
std::optional< std::array< double, 6 > > geographical_extent