FeatureTable

Parsed feature + batch tables from a 3D Tiles container. Each table has a JSON section describing per-feature scalars (or accessor references) and a binary section holding the raw values referenced by the JSON.

Phase 2 only consumes a few fields:

  • b3dm: RTC_CENTER (translation applied to every vertex), BATCH_LENGTH.

  • i3dm: INSTANCES_LENGTH, POSITION / POSITION_QUANTIZED, NORMAL_UP / NORMAL_RIGHT, SCALE / SCALE_NON_UNIFORM.

  • pnts: covered in Phase 3.

Lookup methods return the raw JsonElement (so callers can branch on scalar vs accessor) and the binary section as bytes ready for indexed reads.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Raw binary section; sliced from the input. May be empty when no binary refs are used.

Functions

Link copied to clipboard

Byte offset into binary of the accessor object at key, or null when the key is absent, not a JSON object, or carries no integer byteOffset.

Link copied to clipboard

Compact JSON dump for diagnostics — used in parse-failure messages.

Link copied to clipboard
fun jsonElement(key: String): JsonElement?

Lookup a top-level key. Returns null when absent.

Link copied to clipboard
fun readBytes(key: String, count: Int, components: Int): ByteArray?

Read a uint8 accessor with components per element as a flattened count * components byte array, or null when key is absent.

Link copied to clipboard
fun readScalarFloat(key: String, count: Int): FloatArray?

Read a scalar float32 accessor as a count array, or null when key is absent.

Link copied to clipboard
fun readVec3Float(key: String, count: Int): FloatArray?

Read a vec3 float32 accessor as a flattened count * 3 array, or null when key is absent. Throws when the accessor overruns binary. Shared by the i3dm / pnts loaders.

Link copied to clipboard

Lookup a scalar number. Returns null when the key is missing or is not a primitive.

Link copied to clipboard

Lookup a string value. Returns null when the key is missing, not a primitive, or not a JSON string (e.g. the gltfUpAxis override that some b3dm publishers emit in the feature table to override the tileset-level declaration).

Link copied to clipboard

Decode the feature-table value at key as a 3-tuple of doubles (e.g. RTC_CENTER).