Skip to content

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

Merged
hl662 merged 3 commits into
release/5.7.xfrom
mergify/bp/release/5.7.x/pr-9059
Mar 10, 2026
Merged

Fix reality data not being reprojected correctly when its CRS is different than iModel (backport #9059) [release/5.7.x]#9075
hl662 merged 3 commits into
release/5.7.xfrom
mergify/bp/release/5.7.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 failed:

On branch mergify/bp/release/5.7.x/pr-9059
Your branch is up to date with 'origin/release/5.7.x'.

You are currently cherry-picking commit d122ee67a0.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   common/changes/@itwin/core-frontend/eringram-rd-reproject-crs_2026-03-04-23-15.json
	modified:   core/frontend/src/internal/tile/RealityTileLoader.ts
	modified:   core/frontend/src/test/tile/RealityTile.test.ts

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   docs/changehistory/NextVersion.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@hl662

hl662 commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve merge conflict using the conflict resolver skill

Copilot AI commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

@hl662 I've opened a new pull request, #9078, to work on those changes. Once the pull request is ready, I'll request review from you.

hl662 and others added 2 commits March 10, 2026 11:10
NextVersion.md kept empty for release branch. The reality data CRS
reprojection fix entry is placed under Display > Fixes in 5.7.0.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hl662 hl662 enabled auto-merge (squash) March 10, 2026 17:05
@hl662 hl662 merged commit 92b5266 into release/5.7.x Mar 10, 2026
15 checks passed
@hl662 hl662 deleted the mergify/bp/release/5.7.x/pr-9059 branch March 10, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants