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, surrounding buildings and map terrain. Open View → Layers to adjust Terrain heights.
  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 and lets the viewer enable terrain automatically. Native vectors are released explicitly. Repeated access to viewer.IfcAPI returns the same instance, which is initialized again for the next file.

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

Placement uses RD New and NAP. The building's 20 m reference elevation is an assumption for this demo, based on the facade IFC.

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. The example restores the 3DBAG ground elevations in NAP through the IFC object placements.

The building models share the published S1 horizontal placement and use the facade IFC's 20 m site elevation as an approximate NAP reference. Nearby ground levels were checked against AHN4.