[Kde-imaging] [Bug 134747] GPS Sync: not optimal correlation

Gilles Caulier caulier.gilles at free.fr
Sat Sep 30 11:03:54 CEST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=134747         




------- Additional Comments From caulier.gilles free fr  2006-09-30 11:03 -------
SVN commit 590452 by cgilles:

kipi-plugins from trunk : GPSSync : optimize GPX data parsing to search the minimal diff time.

Fabien, your patch is not optimum because it don't check all items in the list. In fact if the date list of GPS point isn't sorted using time stamp, your optimization don't work.

Of course i will very surprise if the gps data list is not sorted in time (:=))). But like I have none experience with GPS data, we must care about this point.

Please test this patch indeep and give me your feedback. Thanks in advance.

CCBUGS: 134747

 M  +9 -3      gpsdataparser.cpp  


--- trunk/extragear/libs/kipi-plugins/gpssync/gpsdataparser.cpp #590451:590452
 @ -68,6 +68,8  @
     QDateTime cameraGMTDateTime = photoDateTime.addSecs(timeZone*3600*(-1));
 
     // We trying to find the right date in the GPS points list.
+    bool findItem = false;
+    int nbSecItem = maxGapTime;
 
     for (GPSDataMap::Iterator it = m_GPSDataMap.begin();
          it != m_GPSDataMap.end(); ++it )
 @ -77,13 +79,17  @
         
         int nbSecs = abs(cameraGMTDateTime.secsTo( it.key() ));
         
-        if( nbSecs < maxGapTime )
+        // We tring to find the minimal accuracy.
+        if( nbSecs < maxGapTime && nbSecs < nbSecItem)
         {
-            gpsData = m_GPSDataMap[it.key()];
-            return true;
+            gpsData   = m_GPSDataMap[it.key()];
+            findItem  = true;
+            nbSecItem = nbSecs;
         }
     }
 
+    if (findItem) return true;
+
     // If we can't find it, we will trying to interpolate the GPS point.
 
     if (interpolate)


More information about the Kde-imaging mailing list