MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / encode_tile_prefix_with_order

Function encode_tile_prefix_with_order

nodedb-array/src/coord/encode.rs:43–54  ·  view source on GitHub ↗

Encode whichever curve the schema declares for tile boundaries.

(
    schema: &ArraySchema,
    tile_indices: &[u64],
    bits: u32,
)

Source from the content-addressed store, hash-verified

41
42/// Encode whichever curve the schema declares for tile boundaries.
43pub fn encode_tile_prefix_with_order(
44 schema: &ArraySchema,
45 tile_indices: &[u64],
46 bits: u32,
47) -> ArrayResult<u64> {
48 match schema.tile_order {
49 TileOrder::Hilbert | TileOrder::RowMajor | TileOrder::ColMajor => {
50 hilbert::encode(tile_indices, bits)
51 }
52 TileOrder::ZOrder => zorder::encode(tile_indices, bits),
53 }
54}
55
56#[cfg(test)]
57mod tests {

Callers 1

tile_id_for_cellFunction · 0.85

Calls 1

encodeFunction · 0.70

Tested by

no test coverage detected