OrbPro2 a Cesium distribution

StandardsLoader

new Cesium.StandardsLoader(options)

Unified standards ingestion into an EntityCollection.
Name Type Description
options object optional Loader options.
Name Type Default Description
entityCollection EntityCollection | Viewer optional Target collection (or viewer).
idStrategy Object.<string, function()> optional Per-schema id strategy map.
recordIdentityStrategy Object.<string, function()> optional Per-schema mutation record-key strategy map.
schemaEntityTypeMap Object.<string, string> optional Per-schema entity type map for association lookups.
associationKeyStrategy Object.<string, (function()|Object.<string, function()>)> optional Per-entity-type association key strategy map.
streamFrameAdapterMap Object.<string, function()> optional Per-file-ID stream adapters for framed payload bytes.
streamFramePolicyMap Object.<string, (Object|boolean)> optional Per-file-ID stream frame policies.
backgroundMutationOptions object optional Manual background mutation retry/compaction options.
autoRegisterQueryConsumer boolean true optional Whether load/attach operations should automatically register the shared FlatSQL query consumer and mutation registry for the target collection.
updatePolicy number UpdatePolicy.UPSERT optional Default update policy.
propagator string | number | object Propagators.SGP4 optional Default propagator.

Members

static Cesium.StandardsLoader.DefaultIdStrategy

Default per-schema ID extraction.

Methods

attachRecordToEntity(entity, schema, record, options)object

Attach one standards record directly to an entity and register it with the shared mutation registry.
Name Type Description
entity Entity Target entity.
schema string Standards schema (`OMM`, `CAT`, `OEM`, or `OCM`).
record object | Uint8Array | ArrayBuffer | string Standards record payload.
options object optional Attachment options.
Returns:
Attachment summary.
Clear cached association index entries.

compactMutationState(options)number

Compact tombstoned shared standards records immediately.
Name Type Description
options object optional Compaction options.
Returns:
Number of compacted tombstones.

createStreamHandler(options)object

Create a size-prefixed binary stream handler.
Name Type Description
options object optional Stream options.
Name Type Description
loadOptions object optional Per-frame load options forwarded to load methods.
frameRouter function | Object.<string, function()> optional Optional custom framed-payload router.
streamFrameAdapterMap Object.<string, function()> optional Optional per-file-ID adapter overrides.
streamFramePolicyMap Object.<string, (Object|boolean)> optional Optional per-file-ID frame policy overrides.
onMessage function optional Called with (summary, payload) for each handled frame.
onError function optional Called with (error, payload) when routing/ingest fails.
Returns:
Stream handler with pushBytes().
Example:
const loader = new StandardsLoader({
  entityCollection: viewer.entities,
  schemaEntityTypeMap: { CZM: "space", KML: "space", GJN: "space" },
  associationKeyStrategy: {
    space: {
      default: (record) =>
        record?.OBJECT_ID ?? record?.id ?? record?.properties?.OBJECT_ID,
    },
  },
});

const stream = loader.createStreamHandler({
  // Default adapters decode framed $OCM/$CZM/$KML/$GJN payload bodies.
  streamFramePolicyMap: { $OEM: { latestOnly: true } },
  frameRouter: {
    $TDM: (payload, context) => {
      // custom route for app-specific framed payloads
      return false; // fall through to default loader route when not handled
    },
  },
});

flushMutationQueue(options)Promise.<void>

Wait until the shared standards mutation queue is idle.
Name Type Description
options object optional Queue options.
Returns:
Resolves when queued mutations are finished.

getSchemaEntityType(schema)string|undefined

Resolve mapped entity type for a schema.
Name Type Description
schema string Standards schema (OMM/OEM/CAT/CZM/KML/GJN...).
Returns:
Entity type mapping.

hasQueryConsumer(options)boolean

Check whether the target collection is backed by the shared query consumer.
Name Type Description
options object optional Consumer options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
True when shared query state is active.

inspectMutationState(options)object|undefined

Inspect the shared mutation state for the target collection.
Name Type Description
options object optional Inspection options.
Returns:
Shared mutation snapshot.

load(data, options)Promise.<object>

Auto-detect format and load.
Name Type Description
data Resource | string | ArrayBuffer | Uint8Array | object Input data.
options object optional Per-load options.
Returns:
Load summary.

loadCAT(catRecords, options)Promise.<object>

Load CAT records and index them in plugin sqlite by NORAD ID.
Name Type Description
catRecords Array.<object> | string | ArrayBuffer | Uint8Array CAT input.
options object optional Per-load options.
Returns:
Load summary.

loadCDM(cdmData, options)Promise.<object>

Load CDM records.
Name Type Description
cdmData object | Array.<object> | ArrayBuffer | Uint8Array CDM input.
options object optional Per-load options.
Returns:
Load summary.

loadCZML(czmlPackets, options)Promise.<object>

Load CZML packets and merge into target collection.
Name Type Description
czmlPackets Resource | string | object CZML input.
options object optional Per-load options.
Returns:
Load summary.

loadGeoJSON(geojsonData, options)Promise.<object>

Load GeoJSON and merge into target collection.
Name Type Description
geojsonData Resource | string | object GeoJSON input.
options object optional Per-load options.
Returns:
Load summary.

loadKML(kmlData, options)Promise.<object>

Load KML and merge into target collection.
Name Type Description
kmlData Resource | string | Document | Blob KML input.
options object optional Per-load options.
Returns:
Load summary.

loadOCM(ocmData, options)Promise.<object>

Load OCM data.
Name Type Description
ocmData object | Array.<object> OCM input.
options object optional Per-load options.
Returns:
Load summary.

loadOEM(oemData, options)Promise.<object>

Load OEM data.
Name Type Description
oemData Array.<object> | string | ArrayBuffer | Uint8Array OEM input.
options object optional Per-load options.
Returns:
Load summary.

loadOMM(ommRecords, options)Promise.<object>

Load OMM records with batch propagator initialization.
Name Type Description
ommRecords Array.<object> | string | ArrayBuffer | Uint8Array OMM input.
options object optional Per-load options.
Returns:
Load summary.

queryEntityIdsByName(query, maxCount, options)Array.<string>

Query entity IDs by name/id across the full target collection.
Name Type Default Description
query string Text query.
maxCount number 100 optional Max ids to return.
options object optional Query options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
Matching ids.

queryEntityIdsBySql(sql, maxCount, options)Array.<string>

Execute an arbitrary shared SQL query and extract unique entity ids from the projected `entity_id`/`ENTITY_ID` column.
Name Type Default Description
sql string SQL query text.
maxCount number 100 optional Max ids to return.
options object optional Query options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
Matching entity ids.

queryEntityRowsByName(query, maxCount, options)Array.<object>

Query entity rows by name/id across the full target collection.
Name Type Default Description
query string Text query.
maxCount number 100 optional Max rows to return.
options object optional Query options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
Matching rows.

queryEntityRowsBySql(sql, maxRows, options)Array.<object>

Execute an arbitrary shared SQL query against the target collection's FlatSQL-backed entity metadata table.
Name Type Default Description
sql string SQL query text.
maxRows number 1000 optional Max rows to materialize.
options object optional Query options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
Query rows.
Build a visibility mask by name/id across the full target collection.
Name Type Description
query string Text query.
options object optional Query options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
Visibility result.
Execute an arbitrary shared SQL query and build a visibility mask from the projected `entity_id`/`ENTITY_ID` column.
Name Type Description
sql string SQL query text.
options object optional Query options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
Visibility result.

registerQueryConsumer(options)number|undefined

Register the target collection as a shared standards-query consumer.
Name Type Description
options object optional Consumer options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
Stable consumer handle.

setAssociationKeyStrategy(entityType, strategy)

Set association key strategy for one entity type.
Name Type Description
entityType string Entity type name.
strategy function | Object.<string, function()> Association strategy function or per-schema map.

setRecordIdentityStrategy(schema, strategy)

Set one schema mutation-key strategy.
Name Type Description
schema string Standards schema.
strategy function Record-identity strategy.

setSchemaEntityType(schema, entityType)

Set one schema → entity-type mapping.
Name Type Description
schema string Standards schema.
entityType string Entity type name.

setSchemaEntityTypeMap(schemaEntityTypeMap)

Replace schema → entity-type map used for association lookup routing.
Name Type Description
schemaEntityTypeMap Object.<string, string> Mapping object.

setStreamFrameAdapter(fileId, adapter)

Set one framed stream adapter.
Name Type Description
fileId string FlatBuffer file ID token (for example "$OEM").
adapter function | null Adapter function, or null to remove mapping.

setStreamFrameAdapterMap(streamFrameAdapterMap)

Merge framed stream adapter mappings.
Name Type Description
streamFrameAdapterMap Object.<string, function()> Mapping from file ID (for example "$OMM") to adapter function.

setStreamFramePolicy(fileId, policy)

Set one framed stream policy.
Name Type Description
fileId string FlatBuffer file ID token.
policy Object | boolean | null Policy object/boolean, or null to remove mapping.

setStreamFramePolicyMap(streamFramePolicyMap)

Merge framed stream policy mappings.
Name Type Description
streamFramePolicyMap Object.<string, (Object|boolean)> Mapping from file ID to policy.

unregisterQueryConsumer(options)boolean

Unregister the target collection from shared standards-query updates.
Name Type Description
options object optional Consumer options.
Name Type Description
entityCollection EntityCollection | Viewer optional Optional override collection.
Returns:
True when a registered consumer was removed.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.