Skip to content

Fix reality data not being reprojected correctly when its CRS is different than iModel (backport #9059) [release/5.6.x]#9074

Merged
anmolshres98 merged 2 commits into
release/5.6.xfrom
mergify/bp/release/5.6.x/pr-9059
Mar 9, 2026
Merged

Fix reality data not being reprojected correctly when its CRS is different than iModel (backport #9059) [release/5.6.x]#9074
anmolshres98 merged 2 commits into
release/5.6.xfrom
mergify/bp/release/5.6.x/pr-9059

Conversation

@mergify

@mergify mergify Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

There is a bug where when using the reproject parameter of TileTreeReference.createGeometryTreeReference, if the reality data is not in the same CRS than the iModel, the reprojection will put the geometry at the wrong place.

This was because in RealityTileLoader.loadGeometryFromStream, the geometry returned by RealityTileLoader.readGltfAndCreateGeometry is in iModel coordinates, but the reprojection transform is in the reality tree's coordinates.

The fix is to take this difference into account by doing the following:

  1. multiply polyface by inverse of tree's iModelTransform to "convert" polyface from iModel CRS->tile tree CRS
  2. apply the original reprojection transform xForm
  3. multiply by original iModelTransform to convert back from tile tree CRS->iModel CRS

Tested with a couple different iModels with reality data in different CRS. I also added some unit tests for this.


This is an automatic backport of pull request #9059 done by Mergify.

…erent than iModel (#9059)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Polinsky <78756012+ben-polinsky@users.noreply.github.com>
Co-authored-by: Anmol Shrestha <98850418+anmolshres98@users.noreply.github.com>
(cherry picked from commit d122ee6)

# Conflicts:
#	docs/changehistory/NextVersion.md
@mergify mergify Bot added the conflicts label Mar 9, 2026
@mergify mergify Bot requested review from a team, aruniverse, bbastings and ben-polinsky as code owners March 9, 2026 20:49
@mergify

mergify Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of d122ee6 has succeeded.

@anmolshres98 anmolshres98 enabled auto-merge (squash) March 9, 2026 21:03
@anmolshres98 anmolshres98 merged commit d1ff23c into release/5.6.x Mar 9, 2026
15 checks passed
@anmolshres98 anmolshres98 deleted the mergify/bp/release/5.6.x/pr-9059 branch March 9, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants