Table of Contents

Edit IFC georeferencing with web-ifc

Use the native IFC API to position the S1 building and 3DBAG surroundings, then display the edited models on a map.

Open in new tab

How it works

Try it

  1. Compare the building with the surrounding buildings and street map.
  2. Open Files (folder) on the left toolbar and toggle the checkbox beside OMG_KS_3dBAG.ifc to distinguish project geometry from its neighbours.
  3. Zoom to the project boundary to inspect its relationship to the nearby buildings.

Developer integration

Use const api = await viewer.IfcAPI to obtain the complete native web-ifc instance supplied by the SDK. Call Init() and OpenModel() for each downloaded IFC. This API runs on the main thread and owns its models independently of the viewer.

This example reads the project, site and geometric contexts through web-ifc. It updates the site coordinates and true north, writes the IFC2X3 ePSet_ProjectedCRS and ePSet_MapConversion property sets with CreateIfcEntity(), CreateIfcType() and WriteLine(), then saves the edited bytes with SaveModel().

The native model is closed and WASM disposed before the saved bytes are passed to viewer.add(). After all three files load, viewer.toggleMap(true) displays their corrected placement. Native vectors are released explicitly. Repeated access to viewer.IfcAPI returns the same instance, which is initialized again for the next file. Geometry and local heights are retained, and the original downloads are not overwritten.

See the complete web-ifc API reference for all native methods.

Copy this folder and serve it over HTTP, for example python -m http.server 8080. Open http://localhost:8080/; the SDK and sample downloads require internet access.

Model notes

Georeferencing corrected; geometry retained. Heights are local.

Sources and license notices

Geonovum and original model authors · W3C

3DBAG surroundings

The neighbouring buildings in OMG_KS_3dBAG.ifc are derived from 3DBAG. © 3DBAG by tudelft3d and 3DGI · CC BY 4.0. Geonovum distributes the IFC conversion. This example corrects its IFC georeferencing metadata before import; original geometry and local model heights are retained.

The example corrects IFC georeferencing metadata using the published S1 horizontal placement before normal import. Original geometry is retained. Local model heights are used; no surveyed elevation is claimed.