[Marble-devel] New notation enumeration

Carl Gleisner carl.gleisner at gmail.com
Tue Aug 17 14:39:27 CEST 2010


c-4087e253:marble carlgleisner$ git show 4a7f2a44ed2834d99fe975499d66782d84977e83
commit 4a7f2a44ed2834d99fe975499d66782d84977e83
Author: Carl Gleisner <carl.gleisner at gmail.com>
Date:   Mon Aug 9 09:12:36 2010 +0200

    Added MGRS-support to GeoDataCoordinates::toString.

diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 97e18e6..5024a6a 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -21,6 +21,7 @@ INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_SOURCE_DIR}/geodata/parser
  ${CMAKE_CURRENT_SOURCE_DIR}/graphicsview
  ${QT_INCLUDE_DIR}
+ /usr/local/include
 )
 INCLUDE(${QT_USE_FILE})
 INCLUDE(geodata/CMakeLists.txt)
@@ -358,3 +359,6 @@ else (APPLE AND QTONLY)
     DESTINATION ${CMAKE_INSTALL_PREFIX}/include/marble
 )
 endif (APPLE AND QTONLY)
+
+find_library( LIBGEOTRANSQT geotransqt )
+target_link_libraries( marblewidget ${LIBGEOTRANSQT})
diff --git a/src/lib/MarbleViewSettingsWidget.ui b/src/lib/MarbleViewSettingsWidget.u
index bf6a7bf..f6e37fc 100644
--- a/src/lib/MarbleViewSettingsWidget.ui
+++ b/src/lib/MarbleViewSettingsWidget.ui
@@ -105,6 +105,16 @@ p, li { white-space: pre-wrap; }
           <string>Degree (Decimal)</string>
          </property>
         </item>
+        <item>
+         <property name="text">
+          <string>Universal Transverse Mercator (UTM)</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Military Grid Reference System (MGRS)</string>
+         </property>
+        </item>
        </widget>
       </item>
      </layout>
diff --git a/src/lib/geodata/data/GeoDataCoordinates.cpp b/src/lib/geodata/data/GeoDa
index b0f9e3d..84d2ca2 100644
--- a/src/lib/geodata/data/GeoDataCoordinates.cpp
+++ b/src/lib/geodata/data/GeoDataCoordinates.cpp
@@ -28,6 +28,8 @@
 
 #include "Quaternion.h"
 
+#include "geotransqt.h"
+
 namespace Marble
 {
 
@@ -560,6 +562,13 @@ QString GeoDataCoordinates::toString() const
 
 QString GeoDataCoordinates::toString( GeoDataCoordinates::Notation notation, int pre
 {
+               // TODO: Should be "if ( notation == GeoDataCoordinates::MGRS )"
+        if ( notation == GeoDataCoordinates::DMS )
+               return GeotransQt::convertGeodeticToMGRS(d->m_lat, d->m_lon, Geotrans
+               
+        if ( notation == GeoDataCoordinates::UTM )
+               return QString("UTM not implemented");      
+
         return  lonToString( d->m_lon, notation, Radian, precision )
                 + QString(", ")
                 + latToString( d->m_lat, notation, Radian, precision );
diff --git a/src/lib/geodata/data/GeoDataCoordinates.h b/src/lib/geodata/data/GeoData
index 96b9950..d5a51c0 100644
--- a/src/lib/geodata/data/GeoDataCoordinates.h
+++ b/src/lib/geodata/data/GeoDataCoordinates.h
@@ -78,7 +78,9 @@ class GEODATA_EXPORT GeoDataCoordinates
      */
     enum Notation{
         Decimal,
-        DMS
+        DMS,
+        UTM,
+        MGRS
     };
 
     // Type definitions
diff --git a/src/marble.kcfg b/src/marble.kcfg
index 2df5cd9..f16ac72 100644
--- a/src/marble.kcfg
+++ b/src/marble.kcfg
@@ -65,6 +65,7 @@
     <choice name="AngleUnit::DMSDegree"/>
     <choice name="AngleUnit::DecimalDegree"/>
     <choice name="AngleUnit::UTM"/>
+    <choice name="AngleUnit::MGRS"/>
    </choices>
    <default>Marble::DMSDegree</default>
   </entry>


More information about the Marble-devel mailing list