spatial-monorepo / editor/src / RecognitionSession
Class: RecognitionSession
Defined in: packages/editor/src/recognition/RecognitionSession.ts:32
Constructors
Constructor
new RecognitionSession(
adapter,options):RecognitionSession
Defined in: packages/editor/src/recognition/RecognitionSession.ts:40
Parameters
adapter
options
Returns
RecognitionSession
Properties
id
readonlyid:string
Defined in: packages/editor/src/recognition/RecognitionSession.ts:33
Accessors
confidenceThreshold
Get Signature
get confidenceThreshold():
number
Defined in: packages/editor/src/recognition/RecognitionSession.ts:59
Returns
number
features
Get Signature
get features(): readonly
PendingFeature[]
Defined in: packages/editor/src/recognition/RecognitionSession.ts:64
All features, including accepted/rejected ones.
Returns
readonly PendingFeature[]
pendingFeatures
Get Signature
get pendingFeatures():
PendingFeature[]
Defined in: packages/editor/src/recognition/RecognitionSession.ts:69
Features still awaiting an accept/reject decision.
Returns
state
Get Signature
get state():
RecognitionSessionState
Defined in: packages/editor/src/recognition/RecognitionSession.ts:55
Returns
uncertainFeatures
Get Signature
get uncertainFeatures():
PendingFeature[]
Defined in: packages/editor/src/recognition/RecognitionSession.ts:74
Pending features whose confidence is below the threshold (dashed amber in the editor).
Returns
Methods
accept()
accept(
featureId):Feature
Defined in: packages/editor/src/recognition/RecognitionSession.ts:161
Accept a PendingFeature and return it as a Terra Draw–ready GeoJSON feature (pass it to EditorController.addFeature to promote it — from then on it is indistinguishable from a human-drawn feature and participates in undo/redo and IMDF export).
Parameters
featureId
string
Returns
Feature
acceptAll()
acceptAll():
Feature`<Geometry,GeoJsonProperties>`[]
Defined in: packages/editor/src/recognition/RecognitionSession.ts:171
Accept every remaining pending feature; returns the promoted GeoJSON features.
Returns
Feature`<Geometry, GeoJsonProperties>`[]
detect()
detect(
scan,opts?):Promise`<PendingFeature[]>`
Defined in: packages/editor/src/recognition/RecognitionSession.ts:92
Run the adapter on the scan and transform the result to lat/lon PendingFeatures in one batch. idle → detecting → reviewing.
Parameters
scan
opts?
Returns
Promise`<PendingFeature[]>`
reject()
reject(
featureId):void
Defined in: packages/editor/src/recognition/RecognitionSession.ts:166
Parameters
featureId
string
Returns
void
rejectAll()
rejectAll():
void
Defined in: packages/editor/src/recognition/RecognitionSession.ts:176
Reject every remaining pending feature.
Returns
void
subscribe()
subscribe(
listener): () =>void
Defined in: packages/editor/src/recognition/RecognitionSession.ts:79
Subscribe to state/feature changes. Returns an unsubscribe function.
Parameters
listener
() => void
Returns
() => void
