IFClite TypeScript API
    Preparing search index...

    Class GeorefNamespace

    bim.georef — read and write a model's georeferencing.

    IFC4 and IFC4X3 write IfcProjectedCRS + IfcMapConversion (IFC4X3: IfcMapConversionScaled when FactorX/Y/Z are given); IFC2X3 writes the ePSet_MapConversion / ePSet_ProjectedCRS property sets the readers already understand. Writes are held in the session and land in the file with the next bim.export.ifc().

    Writes fail closed and throw a GeoreferencingError naming the missing input: no CRS, map unit, scale or factor is ever assumed; a model without a representation context (IFC2X3: without an IfcSite) is refused; an existing georeferencing is replaced only with replace: true; and values that would contradict each other (an angle and a vector that disagree, a CRS renamed while keeping the old datum) are refused.

    Needs direct store access: the headless CLI and MCP contexts implement it; other backends throw.

    bim.georef.set({
    ProjectedCRS: { Name: 'EPSG:2056', GeodeticDatum: 'CH1903+', MapUnit: 'METRE' },
    MapConversion: { Eastings: 2600000, Northings: 1200000, OrthogonalHeight: 400 },
    rotationDegrees: 12.5,
    });
    const ifc = bim.export.ifc(undefined, {}); // carries the georeferencing
    Index
    • Diagnose the georeferencing (@ifc-lite/georef-check) with the EPSG catalogue and CRS engine wired in. Offline unless allowNetwork; the checks a missing capability prevented are in skipped. A session with unsaved edits is checked as it would be exported.

      Parameters

      Returns Promise<GeorefCheckReport>

      const report = await bim.georef.check();
      const plan = bim.georef.planFixes(report);
      bim.georef.fix(plan); // the `ready` fixes only
    • Write IfcSite RefLatitude / RefLongitude (decimal degrees, WGS84) and RefElevation (project length units). One undo step.

      Parameters

      Returns GeorefSiteWriteResult

      bim.georef.setSite({ RefLatitude: 46.94809, RefLongitude: 7.44744, RefElevation: 540 });