Revit geolocation

From Wiki.OSArch

Revit natively does not allow input of geolocated coordinates. Most users set the N/S, E/W, Elev, and Angle to True North parameters on the Project Base Point and Survey Point objects. Because this workaround is so common and many workflows depend on it, you may continue to apply this workaround without any modification. It is highly advised that the location in Revit of the Project Base Point and the Survey Point is the same.

If your project is primarily vertical, i.e. only one CRS is used, then setting geolocation data is relatively straightforward. If the project is primarily horizontal, i.e. has multiple CRSes, there is currently no established workaround. A standard has yet to be developed. This guide is only for single CRSes. The process is different for IFC2X3 and IFC4.

IFC2X3 Geolocation[edit]

If your project is IFC2X3, you must create a Toposurface object. It must be set to export as an IfcSite object as shown below. When it is set, it will override the auto-generated IfcSite entity that the Revit exporter creates.

Revit-geolocation-topoexport.png

Warning Warning: When a Toposurface object overrides the generated IfcSite object, it will also override any parameters you have set in the Project Information object related to the site. For example, if the Project Information contains a SiteName parameter and the Toposurface object contains an IfcName parameter, the IfcName will take priority. You will be required to transfer all your attributes to the Toposurface object.

This Toposurface must be assigned the instance properties as shown below.

Property Name Required
EPset_ProjectedCRS.Name Yes
EPset_ProjectedCRS.Description
EPset_ProjectedCRS.GeodeticDatum
EPset_ProjectedCRS.VerticalDatum
EPset_ProjectedCRS.MapProjection
EPset_ProjectedCRS.MapZone
EPset_ProjectedCRS.MapUnit
EPset_MapConversion.Eastings Yes
EPset_MapConversion.Northings Yes
EPset_MapConversion.OrthogonalHeight Yes
EPset_MapConversion.XAxisAbscissa Yes
EPset_MapConversion.XAxisOrdinate Yes
EPset_MapConversion.Scale Yes

Once applying these properties in IFC2X3, you will be required to define property sets for export in the default IFC exporter. This is data filled in a text file, which is referenced in the IFC export settings as shown below.

Revit-geolocation-settings.png

The text file must contain the following listing.

PropertySet:	EPset_ProjectedCRS	I	IfcSite
	Name	Text	EPset_ProjectedCRS.Name
	Description	Text	EPset_ProjectedCRS.Description
	GeodeticDatum	Text	EPset_ProjectedCRS.GeodeticDatum
	VerticalDatum	Text	EPset_ProjectedCRS.VerticalDatum
	MapProjection	Text	EPset_ProjectedCRS.MapProjection
	MapZone	Text	EPset_ProjectedCRS.MapZone
	MapUnit	Text	EPset_ProjectedCRS.MapUnit

PropertySet:	EPset_MapConversion	I	IfcSite
	Eastings	Real	EPset_MapConversion.Eastings
	Northings	Real	EPset_MapConversion.Northings
	OrthogonalHeight	Real	EPset_MapConversion.OrthogonalHeight
	XAxisAbscissa	Real	EPset_MapConversion.XAxisAbscissa
	XAxisOrdinate	Real	EPset_MapConversion.XAxisOrdinate
	Scale	Real	EPset_MapConversion.Scale

The downside with this is that this workaround only works with Toposurface objects. This means other disciplines will be required to create an arbitrary Toposurface object. This would allow geolocation to be correctly set, but creates an unnecessary shape representation of the IfcSite. This representation can be removed as follows.

$ ifcpatch -i input.ifc -r RemoveSiteRepresentation

IFC4 Geolocation[edit]

If your project is IFC4, you must set the properties shown below as instance properties to the Project Information object. There is no need to define any property sets for exports in the IFC export settings, as these parameters will be automatically detected.

Property Name Required
ProjectGlobalPositioning.CRSName Yes
ProjectGlobalPositioning.CRSDescription
ProjectGlobalPositioning.CRSGeodeticDatum
ProjectGlobalPositioning.CRSVerticalDatum
ProjectGlobalPositioning.CRSMapProjection
ProjectGlobalPositioning.CRSMapZone
ProjectGlobalPositioning.CRSMapUnit
ProjectGlobalPositioning.Eastings Yes
ProjectGlobalPositioning.Northings Yes
ProjectGlobalPositioning.OrthogonalHeight Yes
ProjectGlobalPositioning.XAxisAbscissa Yes
ProjectGlobalPositioning.XAxisOrdinate Yes
ProjectGlobalPositioning.Scale Yes

IFC2X3 and IFC4 geolocation patching[edit]

Warning Warning: If you do not patch your IFC file, your IFC file will not be correctly geolocated. This applies to both IFC2X3 and IFC4.

When this process is complete of adding parameters either to IFC2X3 Psets or to IFC4 CRS entities, it is assumed that these parameter values are identical to the parameters on the Project Base Point object. This means that any exported IFC will contain a double-up of coordinates: once in the IfcMapConversion entity and another in the Location of the IfcSite entity. Sometimes, this coordinates are recorded in the Location of the IfcBuilding entity. For further reading of how these coordinates are exported, see IFC Coordinate Reference Systems and Revit by Dion Moult.

To fix the double-up of coordinates, you will be required to patch the IFC file exported by Revit. You can patch it using the following IFCPatch recipe:

$ ifcpatch -i input.ifc -r ResetSpatialElementLocations -a IfcSite
$ ifcpatch -i input.ifc -r ResetSpatialElementLocations -a IfcBuilding

A second issue is that the heights of your building storeys are now potentially doubly offset by the map conversion as well as their own absolute coordinates. This can be solved by offsetting all building storeys by a value equivalent to -Orthogonalheight. The following patch applies it, where 12345 is the Orthogonalheight.

$ ifcpatch -i input.ifc -r OffsetStoreyElevations -a "-12345"

IFC2X3 and IFC4 geolocation reference information[edit]

IFC also stores some "reference point" geolocation data. This data includes the latitude and longitude in WGS84. This data is a double up of the more detailed CRS-specific coordinates created above, and is therefore superseded. However, in Revit, it is often incorrectly set, so it is important to ensure that it is correctly defined and corresponds to the CRS-specific coordinates, to prevent unnecessary misunderstandings.

To store the RefLatitude and RefLongitude correctly in the IfcSite object, the CRS coordinates must be converted into WGS84, or EPSG:4326 coordinates. EPSG.io is one online service that provides this, but no guarantee of correctness is provided.

Once converted, they may be entered in the format {latitude},{longitude} in the Revit location dialog as shown below. Once entered, press the Search button to confirm the selection.

Revit-geolocation-refcoords.png

When the Search button is pressed, Revit will attempt to reverse geocode the coordinates. This is not guaranteed to result in a human address that corresponds to the legal address that represents the project entry. It is highly likely that you will be required to override this address. Simply replace the address, and ensure Revit doesn't save over it, as shown below.

Revit-geolocation-addressoverride.png

It is not currently possible to customise the export of the RefElevation attribute of the IfcSite object, but we must fix it as it is likely to be wrong. After calculating the conversion of your OrthogonalHeight in your chosen vertical datum to MSL (Mean Sea Level), you may patch it as follows, where 12345 is the value you want to set.

$ ifcpatch -i input.ifc -r SetRefElevation -a 12345

Revit does not by default export the ElevationOfRefHeight or ElevationOfTerrain attributes of the IfcBuilding. This is not ideal, but not technically illegal, so it may be overlooked.