Skip to content

Commit

Permalink
Merged PR 122160: Reduce threshold where GCS is used to calculate lin…
Browse files Browse the repository at this point in the history
…ear map transform.

When displaying background map we need a linear transform from the BIM coordinates to ECEF -- This is stored as the ECEF location --unfortunately this is not always valid and is not reset after being miscalculated in bridge.   In the case where there is a GCS we can calculate a valid transform - but currently this was only done if project more than 100KM from earth -- reduced this to 5KM -- It should probably be even tighter but will reserve that for future.
  • Loading branch information
RBBentley committed Oct 23, 2020
1 parent 307dc0c commit 266604e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@bentley/imodeljs-frontend",
"comment": "Reduce threshold for ecef validation.",
"type": "none"
}
],
"packageName": "@bentley/imodeljs-frontend",
"email": "[email protected]"
}
4 changes: 3 additions & 1 deletion core/frontend/src/BackgroundMapGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ export class BackgroundMapLocation {

const ecefOriginTest = ecefLocationDbToEcef.multiplyPoint3d(origin);
const cartoOriginTest = Cartographic.fromEcef(ecefOriginTest);
if (cartoOriginTest !== undefined && Math.abs(cartoOriginTest.height) < 1.0E5) {
// If the project center is within 5KM of the ellipsoid then assume that the existing ECEF is valid. Otherwise recalculate
// from the GCS.
if (cartoOriginTest !== undefined && Math.abs(cartoOriginTest.height) < 5.0E3) {
this._ecefValidated = true; // ECEF looks reasonable - use it...
return;
}
Expand Down

0 comments on commit 266604e

Please sign in to comment.