[Kde-imaging] extragear/libs/kipi-plugins/gpssync

Gilles Caulier caulier.gilles at free.fr
Fri Sep 22 16:36:51 CEST 2006


SVN commit 587368 by cgilles:

kipi-plugins from trunk : GPSSync tool : interpolate altitude value like latitude and longitude.

CCMAIL: kde-imaging at kde.org, alexios.beveratos at gmail.com, gerhard at kulzer.net

CCBUGS: 133359, 111560

 M  +3 -1      gpsdataparser.cpp  


--- trunk/extragear/libs/kipi-plugins/gpssync/gpsdataparser.cpp #587367:587368
@@ -104,9 +104,11 @@
             GPSDataContainer prevGPSPoint = m_GPSDataMap[prevDateTime];
             GPSDataContainer nextGPSPoint = m_GPSDataMap[nextDateTime];
 
+            double alt1 = prevGPSPoint.altitude();
             double lon1 = prevGPSPoint.longitude();
             double lat1 = prevGPSPoint.latitude();
             uint   t1   = prevDateTime.toTime_t();
+            double alt2 = nextGPSPoint.altitude();
             double lon2 = nextGPSPoint.longitude();
             double lat2 = nextGPSPoint.latitude();
             uint   t2   = nextDateTime.toTime_t();
@@ -114,7 +116,7 @@
 
             if (t3-t1 != 0)  
             {
-                alt = 0.0;    // We cannot interpolate altitude.
+                alt = alt1 + (alt2-alt1) * (t2-t1)/(t3-t1);
                 lat = lat1 + (lat2-lat1) * (t2-t1)/(t3-t1);
                 lon = lon1 + (lon2-lon1) * (t2-t1)/(t3-t1);
                 isInterpolated = true;    


More information about the Kde-imaging mailing list