Autodesk / Autodesk/revit-ifc

PR: When exporting, scale parameter is missing in georeferencing

Open
#784 5 comments 1 reaction 0 assignees View on GitHub
problem
Dominant language
C#
Stars
637
Forks
225
PR merge metrics
No merged PRs in 30d

Description

### 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](https://github.com/Autodesk/revit-ifc/assets/88302/1cc8a0fb-1336-41aa-9dd3-50ffa2a7434a)

The projected CRS is EPSG:7856.

![image](https://github.com/Autodesk/revit-ifc/assets/88302/268b7f07-9563-4cb5-b4d2-d9c748491f5c)

Revit will export this data in IFC:
[Project2 - Copy.txt](https://github.com/user-attachments/files/16053470/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](https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/link/ifcmapconversion.htm)

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](https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcMapConversionScaled.htm) 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](https://github.com/Autodesk/revit-ifc/assets/88302/513ae1c2-4afa-4446-9093-e63f07cfd59a)

### Revit Version

2023.1.x

### IFC for Revit Addon Version

24.x.x

### Windows Version

11 22H2

Contributor guide

Open the contributing guide

Research direction

Reproduce the export using the supplied blank metric-millimeter project with EPSG:7856, then inspect the generated IFC text around IfcProjectedCRS and IfcMapConversion. Done means the map conversion includes the scale needed to convert project millimeters to CRS meters, reported as 0.001 rather than null.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.