Encode a Hilbert prefix for one cell coordinate using the schema's configured per-dim bit budget.
(schema: &ArraySchema, coord: &[CoordValue])
| 17 | /// Encode a Hilbert prefix for one cell coordinate using the schema's |
| 18 | /// configured per-dim bit budget. |
| 19 | pub fn encode_hilbert_prefix(schema: &ArraySchema, coord: &[CoordValue]) -> ArrayResult<u64> { |
| 20 | let bits = normalize::bits_per_dim(schema.arity()); |
| 21 | let normalized = normalize::normalize_coord(schema, coord, bits)?; |
| 22 | hilbert::encode(&normalized, bits) |
| 23 | } |
| 24 | |
| 25 | /// Encode a Z-order prefix for one cell coordinate. |
| 26 | pub fn encode_zorder_prefix(schema: &ArraySchema, coord: &[CoordValue]) -> ArrayResult<u64> { |