FlatCityBuf C++ reader 0.8.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
fcb::NodeItem Struct Reference

One R-tree node entry: 4 doubles then a u64, all little-endian, 40 bytes with no padding (packed_rtree/mod.rs:23-33). More...

#include <fcb/packed_rtree.hpp>

Public Member Functions

void expand (const NodeItem &r)
 Widens this node's bbox to also cover r, leaving offset untouched.
 
void encode (std::uint8_t *out) const
 Writes this node's 40 bytes (4 LE f64 then a LE u64), matching decode's layout exactly.
 
bool intersects (const BBox &q) const
 Mirrors NodeItem::intersects (packed_rtree/mod.rs:122-134), which uses strict < and >: touching edges DO intersect.
 

Static Public Member Functions

static NodeItem decode (bytes_view b)
 
static NodeItem empty (std::uint64_t offset)
 The "empty" node used as the fold/aggregation identity: any real bbox's expand widens it.
 

Public Attributes

double min_x
 
double min_y
 
double max_x
 
double max_y
 
std::uint64_t offset
 

Static Public Attributes

static constexpr std::size_t kSize = 40
 

Detailed Description

One R-tree node entry: 4 doubles then a u64, all little-endian, 40 bytes with no padding (packed_rtree/mod.rs:23-33).

offset means different things by level: for an INTERNAL node it is the child node INDEX; for a LEAF it is a byte offset relative to the start of the features section.

Definition at line 29 of file packed_rtree.hpp.

Member Function Documentation

◆ decode()

NodeItem fcb::NodeItem::decode ( bytes_view  b)
static

Definition at line 52 of file packed_rtree.cpp.

References fcb::span< T >::data(), kSize, min_x, fcb::NoIndex, and fcb::span< T >::size().

Referenced by fcb::rtree_search_bbox().

◆ empty()

NodeItem fcb::NodeItem::empty ( std::uint64_t  offset)
static

The "empty" node used as the fold/aggregation identity: any real bbox's expand widens it.

Mirrors NodeItem::create (packed_rtree/mod.rs:46-54); named empty here rather than create since it does not take a bbox, only the offset to tag it with.

Definition at line 65 of file packed_rtree.cpp.

References min_x, and offset.

Referenced by fcb::build_packed_rtree(), fcb::calc_extent(), and fcb::FcbWriter::write().

◆ encode()

void fcb::NodeItem::encode ( std::uint8_t *  out) const

Writes this node's 40 bytes (4 LE f64 then a LE u64), matching decode's layout exactly.

Mirrors NodeItem::write (packed_rtree/mod.rs:70-77).

Definition at line 86 of file packed_rtree.cpp.

References max_x, max_y, min_x, min_y, and offset.

◆ expand()

void fcb::NodeItem::expand ( const NodeItem r)

Widens this node's bbox to also cover r, leaving offset untouched.

Mirrors NodeItem::expand (packed_rtree/mod.rs:92-105).

Definition at line 75 of file packed_rtree.cpp.

References max_x, max_y, min_x, and min_y.

Referenced by fcb::build_packed_rtree(), and fcb::calc_extent().

◆ intersects()

bool fcb::NodeItem::intersects ( const BBox q) const

Mirrors NodeItem::intersects (packed_rtree/mod.rs:122-134), which uses strict < and >: touching edges DO intersect.

Definition at line 94 of file packed_rtree.cpp.

References fcb::BBox::max_x, max_x, fcb::BBox::max_y, max_y, fcb::BBox::min_x, min_x, fcb::BBox::min_y, and min_y.

Referenced by fcb::rtree_search_bbox().

Member Data Documentation

◆ kSize

constexpr std::size_t fcb::NodeItem::kSize = 40
staticconstexpr

Definition at line 36 of file packed_rtree.hpp.

Referenced by decode(), fcb::encode_packed_rtree(), and fcb::rtree_search_bbox().

◆ max_x

double fcb::NodeItem::max_x

Definition at line 32 of file packed_rtree.hpp.

Referenced by encode(), expand(), fcb::hilbert_bbox(), and intersects().

◆ max_y

double fcb::NodeItem::max_y

Definition at line 33 of file packed_rtree.hpp.

Referenced by encode(), expand(), fcb::hilbert_bbox(), and intersects().

◆ min_x

double fcb::NodeItem::min_x

◆ min_y

double fcb::NodeItem::min_y

Definition at line 31 of file packed_rtree.hpp.

Referenced by encode(), expand(), fcb::hilbert_bbox(), and intersects().

◆ offset

std::uint64_t fcb::NodeItem::offset

Definition at line 34 of file packed_rtree.hpp.

Referenced by empty(), encode(), and fcb::rtree_search_bbox().


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