10# include <nlohmann/json.hpp>
89 std::optional<AttributeSchema> semantic_attr_schema);
100 void add_feature(
const nlohmann::ordered_json& city_json_feature);
113 void write(std::ostream& out);
119 std::vector<std::uint8_t>
write();
123 std::uint64_t offset;
127 nlohmann::ordered_json cj_;
130 std::optional<AttributeSchema> semantic_attr_schema_;
131 std::vector<std::string> indexing_attr_;
133 std::optional<std::uint16_t> id_column_;
150 std::FILE* tmp_ =
nullptr;
151 std::uint64_t tmp_write_pos_ = 0;
152 bool written_ =
false;
154 std::vector<FeatureSlot> feat_offsets_;
155 std::vector<NodeItem> feat_nodes_;
156 std::vector<std::vector<AttributeIndexEntry>> index_entries_by_feature_;
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(nlohmann::ordered_json cj, FcbWriterOptions options, AttributeSchema attr_schema, std::optional< AttributeSchema > semantic_attr_schema)
cj is the CityJSONSeq's metadata line (first line: type/ version/transform/metadata/etc).
FcbWriter(const FcbWriter &)=delete
FcbWriter(FcbWriter &&)=delete
FcbWriter & operator=(FcbWriter &&)=delete
constexpr std::uint16_t kDefaultNodeSize
constexpr std::uint16_t kDefaultBranchingFactor
Mirrors static_btree::DEFAULT_BRANCHING_FACTOR (static_btree/mod.rs:19), used whenever a caller reque...
std::map< std::string, std::pair< std::uint16_t, ::ColumnType > > AttributeSchema
Attribute schema: name -> (column index, column type).
Configuration for FcbWriter.
std::optional< std::uint16_t > id_index
The branching factor of the index over City Object ids, or std::nullopt to write none.
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