Opened 13 years ago

Closed 6 years ago

Last modified 6 years ago

#1827 closed defect (fixed)

Assertion in CCoordinateSystemMathComparator::SameCoordinateSystem is wrong

Reported by: baertelchen Owned by: baertelchen
Priority: low Milestone:
Component: General Version: 2.1.0
Severity: trivial Keywords: CoordinateSystem API CCoordinateSystemMathComparator SameCoordinateSystem
Cc: External ID:

Description

The assertion

If the units match, the unit scale matches. assert(FloatEqual(def1.unit_scl, def2.unit_scl, kdEpsilonScale));

in the CCoordinateSystemMathComparator::SameCoordinateSystem might report a false-negativ error condition.

CSMAP generates the unit_scl value from the ellipsoid / datum when an ellipsoid / datum is set via [CoordSys::SetEllipsoid / SetDatum] methods.

When then comparing the resulting coordinate system objects, the ellipsoids are considered the same (by the math comparator) but the unit scales are not; at least not by the assert.

For example, the library will cause the process to be terminated in debug builds for the following values:

111321.448098 45299 111321.448098 52280

The assert should be removed as the code isn't doing anything with it anyway.

Change History (4)

comment:1 by jng, 11 years ago

Milestone: 2.5

comment:2 by jng, 11 years ago

Milestone: 2.5

comment:3 by jng, 6 years ago

Resolution: fixed
Status: newclosed

In 9360:

Disable invalid assertion in CCoordinateSystemMathComparator::SameCoordinateSystem

Fixes #1827

comment:4 by jng, 6 years ago

In 9362:

Merged revision(s) 9353, 9360 from trunk/MgDev:
build.bat: Test for "errorlevel not equal to 0" instead of "errorlevel equal to 1" and lay more of these errorlevel checks throughout
........
Disable invalid assertion in CCoordinateSystemMathComparator::SameCoordinateSystem

Fixes #1827
........

Note: See TracTickets for help on using tickets.