From 409da0d9ba2de6bd2ba72f5e03cd62ecdee6a372 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 13 Aug 2025 09:55:58 -0400 Subject: [PATCH 1/3] remove description compare --- .../src/geometry/CoordinateReferenceSystem.ts | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/core/common/src/geometry/CoordinateReferenceSystem.ts b/core/common/src/geometry/CoordinateReferenceSystem.ts index b112598066b1..a10418ac0eba 100644 --- a/core/common/src/geometry/CoordinateReferenceSystem.ts +++ b/core/common/src/geometry/CoordinateReferenceSystem.ts @@ -281,6 +281,46 @@ export class HorizontalCRS implements HorizontalCRSProps { return true; } + + /** Compares two horizontal CRS, but does not compare descriptions. + * Number compares are applied a minuscule tolerance. + * @public */ + public almostEquals(other: HorizontalCRS): boolean { + if (this.id !== other.id || + this.source !== other.source || + this.deprecated !== other.deprecated || + this.epsg !== other.epsg || + this.datumId !== other.datumId || + this.ellipsoidId !== other.ellipsoidId || + this.unit !== other.unit) + return false; + + if ((this.datum === undefined) !== (other.datum === undefined)) + return false; + + if (this.datum && !this.datum.equals(other.datum!)) + return false; + + if ((this.ellipsoid === undefined) !== (other.ellipsoid === undefined)) + return false; + + if (this.ellipsoid && !this.ellipsoid.equals(other.ellipsoid!)) + return false; + + if ((this.projection === undefined) !== (other.projection === undefined)) + return false; + + if (this.projection && !this.projection.equals(other.projection!)) + return false; + + if ((this.extent === undefined) !== (other.extent === undefined)) + return false; + + if (this.extent && !this.extent.equals(other.extent!)) + return false; + + return true; + } } /** Vertical Geographic Coordinate reference System definition From f5657450245d1f7d66ebe923c337cc71cf2ab323 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 13 Aug 2025 11:19:07 -0400 Subject: [PATCH 2/3] better name --- core/common/src/geometry/CoordinateReferenceSystem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/common/src/geometry/CoordinateReferenceSystem.ts b/core/common/src/geometry/CoordinateReferenceSystem.ts index a10418ac0eba..f8d5b89e052a 100644 --- a/core/common/src/geometry/CoordinateReferenceSystem.ts +++ b/core/common/src/geometry/CoordinateReferenceSystem.ts @@ -285,7 +285,7 @@ export class HorizontalCRS implements HorizontalCRSProps { /** Compares two horizontal CRS, but does not compare descriptions. * Number compares are applied a minuscule tolerance. * @public */ - public almostEquals(other: HorizontalCRS): boolean { + public isEquivalent(other: HorizontalCRS): boolean { if (this.id !== other.id || this.source !== other.source || this.deprecated !== other.deprecated || From 1d23151f7d98585c33b79a538cef19769d0c1658 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 13 Aug 2025 15:51:10 -0400 Subject: [PATCH 3/3] add no-non-null-assertion --- core/common/src/geometry/CoordinateReferenceSystem.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/common/src/geometry/CoordinateReferenceSystem.ts b/core/common/src/geometry/CoordinateReferenceSystem.ts index c9f87cc54e5f..2e0e97d23a9e 100644 --- a/core/common/src/geometry/CoordinateReferenceSystem.ts +++ b/core/common/src/geometry/CoordinateReferenceSystem.ts @@ -302,24 +302,28 @@ export class HorizontalCRS implements HorizontalCRSProps { if ((this.datum === undefined) !== (other.datum === undefined)) return false; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion if (this.datum && !this.datum.equals(other.datum!)) return false; if ((this.ellipsoid === undefined) !== (other.ellipsoid === undefined)) return false; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion if (this.ellipsoid && !this.ellipsoid.equals(other.ellipsoid!)) return false; if ((this.projection === undefined) !== (other.projection === undefined)) return false; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion if (this.projection && !this.projection.equals(other.projection!)) return false; if ((this.extent === undefined) !== (other.extent === undefined)) return false; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion if (this.extent && !this.extent.equals(other.extent!)) return false;