Please also refer to a more general article on Geo referencing in IFC
The BIM.works 3D Viewer has two modes: LOCAL and GEO. By default it is in LOCAL mode. The viewer can only be switched to GEO mode if all loaded models have a GeoReference. Certain features such as the base layers (for example open streetmap) and 3D Tiles can only be used in GEO mode.
When in LOCAL mode, the local coordinates of the models are used. When you have one model close to the origin, and another model at 500KM away, the viewer cannot function. This situation can be checked by comparing the bounding boxes of the models.
To get the bounding box of a model, you can call BimWorksClient.fs.getNodeVersion
The im_metadata JSON contains the bounding box (transformedBoundsMm or transformedBounds, the latter using model units).
When in GEO mode, the transformed coordinates of the building can also be too far apart. This can be detected by comparing the Geo References of the models. You can use the getGeoReference API call mentioned under “Checking GeoReference”.
You can use the BimWorksClient.gis.getGeoReference API call to get the GeoReference of a model. If it returns null the model does not have a GeoReference. This information can be used to show a message to the user. Keep in mind that almost all IFC models have a Geo Reference, usually incorrect, but they have one.
Returns the GeoReference that has been stored on a Version.
JS Doc: https://bimbase.nl/docs/1.3/ts/classes/_bimworks_jssdk.Gis.html#getGeoReference
Changes the stored GeoReference of the given Version.
JS Doc: https://bimbase.nl/docs/1.3/ts/classes/_bimworks_jssdk.Gis.html#setGeoReference