FlatCityBuf C++ reader 0.10.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
fcb::FcbReader Class Reference

The library's entry point. More...

#include <fcb/reader.hpp>

Public Member Functions

const HeaderView & header () const
FeatureIterator select_all ()
 Iterate every feature in stored (Hilbert) order.
FeatureIterator select_bbox (const BBox &query)
 Iterate features whose 2D bounding box intersects query.
FeatureIterator select_attr (const AttrQuery &query, AttrQueryOptions opts={})
 Iterate features matching every condition (AND).

Static Public Member Functions

static FcbReader open_file (const std::string &path)
static FcbReader open (std::shared_ptr< RangeReader > reader)

Detailed Description

The library's entry point.

Definition at line 67 of file reader.hpp.

Member Function Documentation

◆ header()

const HeaderView & fcb::FcbReader::header ( ) const
inline

Definition at line 72 of file reader.hpp.

Referenced by open().

◆ open()

FcbReader fcb::FcbReader::open ( std::shared_ptr< RangeReader > reader)
static

Definition at line 230 of file reader.cpp.

References header(), and fcb::read_header().

Referenced by open_file().

◆ open_file()

FcbReader fcb::FcbReader::open_file ( const std::string & path)
static

Definition at line 226 of file reader.cpp.

References open().

◆ select_all()

FeatureIterator fcb::FcbReader::select_all ( )

Iterate every feature in stored (Hilbert) order.

Definition at line 504 of file reader.cpp.

References fcb::SequentialScan.

◆ select_attr()

FeatureIterator fcb::FcbReader::select_attr ( const AttrQuery & query,
AttrQueryOptions opts = {} )

Iterate features matching every condition (AND).

Fixed-width string keys are truncated to 50 or 100 bytes, so the index yields CANDIDATES for those columns; by default each is verified against the decoded, untruncated attribute before being returned. That makes this stricter than the Rust reader, which returns the false positives. Matching is existential: a feature matches if any of its CityObjects satisfies the condition. Each feature is returned at most once.

Definition at line 344 of file reader.cpp.

References fcb::AttributeIndexNotFound, fcb::Feature::byte_offset(), fcb::Feature::city_object_count(), fcb::FeatureIterator::current(), fcb::decode_attributes(), fcb::AttrQueryOptions::exact_index_only, fcb::ColumnInfo::index, fcb::key_kind_for_column(), fcb::FeatureIterator::next(), fcb::Feature::object_attributes(), fcb::Feature::object_columns(), fcb::Feature::object_has_columns(), fcb::Feature::object_id(), fcb::OffsetList, fcb::ColumnInfo::primary_key, fcb::QueryExecutionError, fcb::stree_query(), fcb::AttrValue::String, fcb::AttrValue::type, fcb::ColumnInfo::type, and fcb::UnsupportedColumnType.

◆ select_bbox()

FeatureIterator fcb::FcbReader::select_bbox ( const BBox & query)

Iterate features whose 2D bounding box intersects query.

The R-tree is 2D only, so any z filtering is the caller's job. Returns an empty iterator when nothing matches – which is distinct from a sequential scan, hence IterationMode.

Definition at line 235 of file reader.cpp.

References fcb::NoIndex, fcb::OffsetList, and fcb::rtree_search_bbox().


The documentation for this class was generated from the following files: