[mapguide-commits] r6167 - in trunk/MgDev/Common: CoordinateSystem
Geometry/CoordinateSystem
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Oct 5 10:45:23 EDT 2011
Author: baertelchen
Date: 2011-10-05 07:45:22 -0700 (Wed, 05 Oct 2011)
New Revision: 6167
Modified:
trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp
trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.h
trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMathComparator.h
Log:
This submission fixes ticket 1825 (http://trac.osgeo.org/mapguide/ticket/1825).
The new API
[SetCompareInternalDatumOldParameters] and [GetCompareInternalDatumOldParameters] has been added to the [MgCoordinateSystemMathComparator] class.
These methods allow an API client to disable the comparison of geodetic transformation information when comparing 2 datums. Due to the changes done in RFC94 and the CSMAP RFC2, comparing the geodetic transformation directly on the datum is no longer necessary as the information is retrieved from a separate dictionary by CSMAP.
With this submission, the default behavior is kept so that a new math comparator object would still check these properties by default.
See also the addendum section for RFC94.
Changes reviewed by Hugues.
Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp 2011-10-05 08:30:21 UTC (rev 6166)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp 2011-10-05 14:45:22 UTC (rev 6167)
@@ -39,6 +39,7 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CCoordinateSystemMathComparator::CCoordinateSystemMathComparator()
+ : m_bCompareDatumOldParameters(true)
{
}
@@ -52,6 +53,16 @@
delete this;
}
+void CCoordinateSystemMathComparator::SetCompareInternalDatumOldParameters(bool bCompareDatumOldParameters)
+{
+ this->m_bCompareDatumOldParameters = bCompareDatumOldParameters;
+}
+
+bool CCoordinateSystemMathComparator::GetCompareInternalDatumOldParameters()
+{
+ return this->m_bCompareDatumOldParameters;
+}
+
// Returns whether the two defs are the same, mathematically.
// Non-mathematical attributes such as description are ignored
// for comparison purposes.
@@ -165,6 +176,9 @@
Ptr<MgCoordinateSystemEllipsoid> pEllipsoid2 = pDefinition2->GetEllipsoidDefinition ();
if (!SameEllipsoid (pEllipsoid1,pEllipsoid2)) return false;
+ if (!this->m_bCompareDatumOldParameters)
+ return true;
+
// Determine if the two definitions are both the null transformation.
orgDeltaZeroCount = (def1.delta_X == 0.0);
orgDeltaZeroCount += (def1.delta_Y == 0.0);
Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.h
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.h 2011-10-05 08:30:21 UTC (rev 6166)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysMathComparator.h 2011-10-05 14:45:22 UTC (rev 6167)
@@ -43,10 +43,16 @@
virtual bool SameDatum(MgCoordinateSystemDatum *pDefinition1, MgCoordinateSystemDatum *pDefinition2);
virtual bool SameCoordinateSystem(MgCoordinateSystem *pDefinition1, MgCoordinateSystem *pDefinition2);
+ virtual void SetCompareInternalDatumOldParameters(bool);
+ virtual bool GetCompareInternalDatumOldParameters();
+
protected:
// INT32 GetClassId();
//from MgDisposable
virtual void Dispose();
+
+private:
+ bool m_bCompareDatumOldParameters;
};
} // End of namespace
Modified: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMathComparator.h
===================================================================
--- trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMathComparator.h 2011-10-05 08:30:21 UTC (rev 6166)
+++ trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMathComparator.h 2011-10-05 14:45:22 UTC (rev 6167)
@@ -32,6 +32,21 @@
virtual bool SameDatum(MgCoordinateSystemDatum *pDefinition1, MgCoordinateSystemDatum *pDefinition2)=0;
virtual bool SameCoordinateSystem(MgCoordinateSystem *pDefinition1, MgCoordinateSystem *pDefinition2)=0;
+ /////////////////////////////////////////////////////////////
+ /// \brief
+ /// Disables or enables the comparison of any integral geodetic transformation information
+ /// when comparing datums. By default, this class compares any geodetic transformation
+ /// information it finds. If set to false, the \link SameDatum method
+ /// only compares ellipsoid information and any other, non-transformation related, properties.
+ virtual void SetCompareInternalDatumOldParameters(bool) = 0;
+
+ /////////////////////////////////////////////////////////////
+ /// \brief
+ /// Returns the current comparison behavior for datums of this MgCoordinateSystemMathComparator
+ /// object. If true (default), this comparator compares geodetic transformation information
+ /// it might find for a datum object. If false, this comparison step is skipped.
+ virtual bool GetCompareInternalDatumOldParameters() = 0;
+
protected:
/////////////////////////////////////////////////////////////////
/// \brief
More information about the mapguide-commits
mailing list