SnapshotConnection Class

A connection to a SnapshotDb hosted on a backend.

Extends

Methods

Name Description
close(): Promise<void> Close this SnapshotConnection.  
isSnapshotConnection(): this is SnapshotConnection Type guard for instanceof SnapshotConnection  
openFile(filePath: string): Promise<SnapshotConnection> Static Open an IModelConnection to a read-only snapshot iModel from a file name.  
openRemote(fileKey: string): Promise<SnapshotConnection> Static Open an IModelConnection to a remote read-only snapshot iModel from a key that will be resolved by the backend.  

Inherited methods

Name Inherited from Description
cartographicToSpatial(cartographic: Cartographic, result?: Point3d): Promise<Point3d> IModelConnection Convert a Cartographic to a point in this iModel's Spatial coordinates using the Geographic location services for this IModelConnection or ecefLocation.
cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d): Point3d IModelConnection Convert a Cartographic to a point in this iModel's Spatial coordinates using its ecefLocation.
cartographicToSpatialFromGcs(cartographic: Cartographic, result?: Point3d): Promise<Point3d> IModelConnection Convert a Cartographic to a point in this iModel's Spatial coordinates using the Geographic location services for this IModelConnection.
createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader IModelConnection Allow to execute query and read results along with meta data.
ecefToSpatial(ecef: Readonly<WritableXYAndZ>, result?: Point3d): Point3d IModelConnection Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its IModelConnection.ecefLocation.
expandDisplayedExtents(range: Range3d): void IModelConnection Expand this iModel's IModelConnection.displayedExtents to include the specified range.
findClassFor<T extends undefined>(className: string, defaultClass: undefined | T): Promise<undefined | T> IModelConnection Find the first registered base class of the given EntityState className.
generateElementMeshes(requestProps: ElementMeshRequestProps): Promise<Uint8Array> IModelConnection Produce encoded Polyfaces from the geometry stream of a GeometricElement.
getEcefTransform(): Transform IModelConnection Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its ecefLocation.
getGeometryContainment(requestProps: GeometryContainmentRequestProps): Promise<GeometryContainmentResponseProps> IModelConnection Request element clip containment status from the backend.
getGeometrySummary(requestProps: GeometrySummaryRequestProps): Promise<string> IModelConnection Obtain a summary of the geometry belonging to one or more GeometricElements suitable for debugging and diagnostics.
getMassProperties(requestProps: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> IModelConnection Request element mass properties from the backend.
getMassPropertiesPerCandidate(requestProps: MassPropertiesPerCandidateRequestProps): Promise<MassPropertiesPerCandidateResponseProps[]> IModelConnection Request mass properties for multiple elements from the backend.
getRpcProps(): IModelRpcProps IModelConnection Return a token for RPC operations.
getToolTipMessage(id: string): Promise<string[]> IModelConnection Request a tooltip from the backend.
isBlankConnection(): this is BlankConnection IModelConnection Type guard for instanceof BlankConnection
isBriefcaseConnection(): this is BriefcaseConnection IModelConnection Type guard for instanceof BriefcaseConnection
isCheckpointConnection(): this is CheckpointConnection IModelConnection Type guard for instanceof CheckpointConnection
loadFontMap(): Promise<FontMap> IModelConnection Load the FontMap for this IModelConnection.
query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> IModelConnection Execute a query and stream its results
queryEntityIds(params: EntityQueryParams): Promise<Id64Set> IModelConnection Query for a set of element ids that satisfy the supplied query params
queryRowCount(ecsql: string, params?: QueryBinder): Promise<number> IModelConnection Compute number of rows that would be returned by the ECSQL.
queryTextureData(textureLoadProps: TextureLoadProps): Promise<undefined | TextureData> IModelConnection Request a named texture image from the backend.
restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> IModelConnection Cancel any previous query with same token and run execute the current specified query.
setEcefLocation(ecef: EcefLocationProps): void IModelConnection Set the EcefLocation for this iModel.
setGeographicCoordinateSystem(geoCRS: GeographicCRSProps): void IModelConnection Sets the geographic coordinate reference system from GeographicCRSProps.
spatialToCartographic(spatial: Readonly<WritableXYAndZ>, result?: Cartographic): Promise<Cartographic> IModelConnection Convert a point in this iModel's Spatial coordinates to a Cartographic using the Geographic location services for this IModelConnection or ecefLocation.
spatialToCartographicFromEcef(spatial: Readonly<WritableXYAndZ>, result?: Cartographic): Cartographic IModelConnection Convert a point in this iModel's Spatial coordinates to a Cartographic using its ecefLocation.
spatialToCartographicFromGcs(spatial: Readonly<WritableXYAndZ>, result?: Cartographic): Promise<Cartographic> IModelConnection Convert a point in this iModel's Spatial coordinates to a Cartographic using the Geographic location services for this IModelConnection.
spatialToEcef(spatial: Readonly<WritableXYAndZ>, result?: Point3d): Point3d IModelConnection Convert a point in this iModel's Spatial coordinates to an ECEF point using its ecefLocation.
getDefaultSubCategoryId(categoryId: string): string Static IModelConnection Get the default subCategoryId for the supplied categoryId

Properties

Name Type Description
iModelId Accessor ReadOnly string The Guid that identifies this iModel.  
isClosed Accessor ReadOnly boolean Returns true if SnapshotConnection.close has already been called.  
isRemote Accessor ReadOnly boolean Returns true if this is a connection to a remote snapshot iModel resolved by the backend.  

Inherited properties

Name Type Inherited from Description
_openMode Protected OpenMode IModelConnection  
categories Readonly IModelConnection.Categories IModelConnection The set of Category's in this IModelConnection.
changeset ChangesetIdWithIndex IModelConnection  
codeSpecs Readonly IModelConnection.CodeSpecs IModelConnection The CodeSpecs in this IModelConnection.
connectionTimeout Static number IModelConnection The maximum time (in milliseconds) to wait before timing out the request to open a connection to a new iModel
dictionaryId StaticReadonly string IModelConnection The Id of the dictionary model.
displayedExtents Readonly Range3d IModelConnection The displayed extents of this iModel, initialized to IModel.projectExtents.
ecefLocation Accessor undefined | EcefLocation IModelConnection The EcefLocation of the iModel in Earth Centered Earth Fixed coordinates.
If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a
3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem
property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the
iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that
results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.
If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective
cartographic projection used and a linear transformation should then be calculated at the exact origin of the data
it must position.
elements Readonly IModelConnection.Elements IModelConnection The ElementStates in this IModelConnection.
fontMap undefined | FontMap IModelConnection The font map for this IModelConnection.
geographicCoordinateSystem Accessor undefined | GeographicCRS IModelConnection The geographic coordinate reference system of the iModel.
globalOrigin Accessor Point3d IModelConnection An offset to be applied to all spatial coordinates.
hilited Readonly HiliteSet IModelConnection The set of currently hilited elements for this IModelConnection.
isBlank Accessor ReadOnly boolean IModelConnection True if this is a Blank Connection.
isBriefcase Accessor ReadOnly boolean IModelConnection Returns true if this is a briefcase copy of an iModel that is synchronized with iModelHub.
isGeoLocated Accessor ReadOnly boolean IModelConnection True if this iModel has an EcefLocation.
isOpen Accessor ReadOnly boolean IModelConnection Check if the IModelConnection is open (i.e. it has a connection to a backend server).
Returns false for BlankConnection instances and after IModelConnection.close has been called.
isReadonly Accessor ReadOnly boolean IModelConnection Check the IModelConnection.openMode of this IModelConnection to see if it was opened read-only.
isSnapshot Accessor ReadOnly boolean IModelConnection Returns true if this is a snapshot iModel.
iTwinId Accessor ReadOnly undefined | string IModelConnection The Guid that identifies the iTwin that owns this iModel.
key Accessor ReadOnly string IModelConnection Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications.
models Readonly IModelConnection.Models IModelConnection The ModelStates in this IModelConnection.
name Accessor string IModelConnection Name of the iModel
onClose Readonly BeEvent<(_imodel: IModelConnection) => void> IModelConnection Event called immediately before this IModelConnection is closed.
onClose StaticReadonly BeEvent<(_imodel: IModelConnection) => void> IModelConnection Event called immediately before any IModelConnection is closed.
onEcefLocationChanged Readonly BeEvent<(previousLocation: undefined | EcefLocation) => void> IModelConnection Event raised after IModelConnection.ecefLocation changes.
onGeographicCoordinateSystemChanged Readonly BeEvent<(previousGCS: undefined | GeographicCRS) => void> IModelConnection Event raised after IModelConnection.geographicCoordinateSystem changes.
onGlobalOriginChanged Readonly BeEvent<(previousOrigin: Point3d) => void> IModelConnection Event raised after IModelConnection.globalOrigin changes.
onNameChanged Readonly BeEvent<(previousName: string) => void> IModelConnection Event raised after IModelConnection.name changes.
onOpen StaticReadonly BeEvent<(_imodel: IModelConnection) => void> IModelConnection Event called immediately after any IModelConnection is opened.
onProjectExtentsChanged Readonly BeEvent<(previousExtents: Range3d) => void> IModelConnection Event raised after IModelConnection.projectExtents changes.
onRootSubjectChanged Readonly BeEvent<(previousSubject: RootSubjectProps) => void> IModelConnection Event raised after IModelConnection.rootSubject changes.
openMode Accessor ReadOnly OpenMode IModelConnection The OpenMode used for this IModel.
projectExtents Accessor Range3d IModelConnection The volume, in spatial coordinates, inside which the entire project is contained.
repositoryModelId StaticReadonly string IModelConnection The Id of the repository model.
rootSubject Accessor RootSubjectProps IModelConnection The name and description of the root subject of this iModel
rootSubjectId StaticReadonly string IModelConnection The Id of the root subject element.
routingContext IModelRoutingContext IModelConnection The RPC routing for this connection.
selectionSet Readonly SelectionSet IModelConnection The set of currently selected elements for this IModelConnection.
tiles Readonly Tiles IModelConnection The set of Tiles for this IModelConnection.
transientIds Readonly TransientIdSequence IModelConnection Generator for unique Ids of transient graphics for this IModelConnection.
views Readonly IModelConnection.Views IModelConnection The ViewStates in this IModelConnection.

Defined in

Last Updated: 30 November, 2023