[mapguide-commits] r5038 - in trunk/MgDev/Common: CoordinateSystem Geometry/CoordinateSystem

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jul 19 12:28:44 EDT 2010


Author: NormOlsen
Date: 2010-07-19 16:28:44 +0000 (Mon, 19 Jul 2010)
New Revision: 5038

Modified:
   trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSys.h
   trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h
Log:
RFC 98, MapGuide Trac # 1405

This submission exposes the new EPSG, SRID, and EPSG Quadrant information added to the CS-MAP dictionaries by CS-MAP RFC 3.  There is no change to any existing API.  The new API's will return zero if the requested information is not known; thus no exceptions are thrown.

The trhee new API's are all members of the MgCoordinateSystem interface and are as follows:
    INT32 GetEpsgCode (void);
    INT32 GetSridCode (void);
    INT16 GetEpsgQuadrant (void);

__NOTE__  Following this submission, version #1868 of CS-MAP is required in order to achieve a successful build.


Modified: trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2010-07-19 13:36:22 UTC (rev 5037)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2010-07-19 16:28:44 UTC (rev 5038)
@@ -1268,7 +1268,37 @@
     }
     return m_pEllipsoid->GetDescription();
 }
-
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Returns the EPSG code for this system, else zero.
+/// </summary>
+INT32 CCoordinateSystem::GetEpsgCode (void)
+{
+     return static_cast<INT32>(m_csprm.csdef.epsgNbr);
+}
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Returns the Oracle SRID code for this system, else zero.
+/// </summary>
+INT32 CCoordinateSystem::GetSridCode (void)
+{
+     return static_cast<INT32>(m_csprm.csdef.srid);
+}
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Returns the quadrant specification in the EPSG data set for
+/// this definition.  The returned value is zero if the system
+/// does not have an EPSG equivalent.  The format of the
+/// returned value is in the same form as the CS-MAP quad value,
+/// but the value may be different.  CS-MAP definitions often
+/// ignore the swapping of axes as is indicated in the EPSG
+/// database.  Not doing so produces rotated and mirroed displays
+/// which are _NOT_ what the customer desires or expects.
+/// </summary>
+INT16 CCoordinateSystem::GetEpsgQuadrant (void)
+{
+     return static_cast<INT16>(m_csprm.csdef.epsg_qd);
+}
 ///////////////////////////////////////////////////////////////////////////
 MgStringCollection* CCoordinateSystem::GetCategories()
 {
@@ -3025,7 +3055,7 @@
     }
     m_csprm.csdef.quad = 1;
     m_csprm.csdef.order = m_csprm.csdef.zones = 0;
-    m_csprm.csdef.auto_geoid = m_csprm.csdef.elev_tech = 0;
+    m_csprm.csdef.epsgNbr = m_csprm.csdef.srid = m_csprm.csdef.epsg_qd = 0;
 
     //Set defaults specifically according to the current projection
     //type.  If the current projection type is undefined, set to zero.

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSys.h
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSys.h	2010-07-19 13:36:22 UTC (rev 5037)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSys.h	2010-07-19 16:28:44 UTC (rev 5038)
@@ -72,6 +72,10 @@
     virtual STRING GetEllipsoid();  /// __get
     virtual STRING GetEllipsoidDescription();  /// __get
 
+    virtual INT32 GetEpsgCode (void);  /// __get
+    virtual INT32 GetSridCode (void);  /// __get
+    virtual INT16 GetEpsgQuadrant (void);   /// __get
+
     virtual MgCoordinateSystemMeasure* GetMeasure();
     virtual MgStringCollection* GetCategories();
     virtual MgCoordinateSystemCatalog* GetCatalog();

Modified: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h
===================================================================
--- trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h	2010-07-19 13:36:22 UTC (rev 5037)
+++ trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystem.h	2010-07-19 16:28:44 UTC (rev 5038)
@@ -58,6 +58,10 @@
     virtual STRING GetEllipsoid()=0;  /// __get
     virtual STRING GetEllipsoidDescription()=0;  /// __get
 
+    virtual INT32 GetEpsgCode (void)=0;  /// __get
+    virtual INT32 GetSridCode (void)=0;  /// __get
+    virtual INT16 GetEpsgQuadrant (void)=0;   /// __get
+
     virtual MgCoordinateSystemMeasure* GetMeasure()=0;
     virtual MgStringCollection* GetCategories()=0;
     virtual MgCoordinateSystemCatalog* GetCatalog()=0;



More information about the mapguide-commits mailing list