Autodesk / revit-ifc

IFC for Revit and Navisworks (2019+)
477 stars 194 forks source link

PR: When exporting, scale parameter is missing in georeferencing #784

Open Moult opened 3 months ago

Moult commented 3 months ago

Problem Description

Here is a blank project in metric millimeters as the project unit. The coordinates at the PBP is 10,000mm and 20,000mm.

image

The projected CRS is EPSG:7856.

image

Revit will export this data in IFC: Project2 - Copy.txt

#19=IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.);
#97=IFCUNITASSIGNMENT((#19,#21,#22,#26,#27,#30,#31,#33,#34,#35,#37,#40,#42,#46,#47,#48,#49,#50,#51,#52,#53,#54,#55,#56,#61,#64,#66,#69,#70,#71,#72,#73,#74,#75,#76,#77,#79,#80,#81,#82,#83,#84,#85,#86,#88,#89,#91,#92,#94,#95,#96));
...
#105=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#106=IFCPROJECTEDCRS('EPSG:7856','Map Grid of Australia Zone 56, GDA2020 (7Parameter)','GDA2020-7P',$,$,$,#105);
#107=IFCMAPCONVERSION(#100,#106,20.000000000000004,10.000000000000002,0.,1.,6.1230317691118863E-17,$);
...

As you can see:

  1. Project units are in mm (good)
  2. Projected CRS defined (good)
  3. Projected CRS has a map unit of meters (sure)
  4. Map conversion has an easting and northings of 20 and 10 (in meters, good :) it matches the map unit which is great!)
  5. Map conversion has a null value for Scale (bug)

IFC states:

The scale factor can be used when the length unit for the 3 axes of the map coordinate system are not identical with the length unit established for this project (see IfcProject.UnitsInContext), if omitted, the scale factor 1.0 is assumed.

and repeats itself

Scale to be used, when the units of the CRS are not identical to the units of the engineering coordinate system. If omited, the value of 1.0 is assumed.

on the docs for IfcMapConversion

Because it is omitted, the value of 1.0 is assumed. But the units of the CRS (m) are not identical to the project units (mm). So this is not correct - there needs to be a value for scale.

According to this equation as you can see first we scale the project units XYZ then we add the eastings/northings. So the scale should be equal to 0.001 (to go from mm -> m, then we can add the eastings/northings in m).

(ignore the FactorXYZ that is for IfcMapConversionScaled but the general equation still applies)

image

Revit Version

2023.1.x

IFC for Revit Addon Version

24.x.x

Windows Version

11 22H2

AngelVelezSosa commented 3 months ago

This looks like a likely oversight to add this scale - will add issue to address this shortly.

enruilo1 commented 2 months ago

This looks like a likely oversight to add this scale - will add issue to address this shortly.

Thank you, this is a real problem to address properly georreferencing.