Version: svn (using KDE KDE 3.5.2) Installed from: Ubuntu Packages OS: Linux When parsing a gpx file, gpssync stops at the first match when interval < max gap. Extract from source code gpsdataparser.cpp: for (GPSDataMap::Iterator it = m_GPSDataMap.begin(); it != m_GPSDataMap.end(); ++it ) { // Here we check a possible accuracy in seconds between the // Camera GMT time and the GPS device GMT time. int nbSecs = abs(cameraGMTDateTime.secsTo( it.key() )); if( nbSecs < maxGapTime ) { gpsData = m_GPSDataMap[it.key()]; return true; } } But, the first match is usually not the best one. gpssync should continue to iterate until it find the best value (min interval)...
Created attachment 17939 [details] picture with no GPS tags
Created attachment 17940 [details] picture with no GPS tags
Created attachment 17941 [details] Picture with GPS tags
Created attachment 17942 [details] GPX file
Created attachment 17943 [details] Small and dirty patch This is a very dirty hack to get the best gps values...
BTW, timezone is GMT+2
Fabien, 3 images are the same with the same date ! Gilles
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)
Fabien, Can you give me a fresh feedback about my last fix ? Its work fine for you ? Gilles
Hello, Sorry for this late answer... Yes, it's working really fine ! I tried with different gpx files containing 1 or more tracks and it's ok ! I even tried to merge in a single gpx file 2 tracks from 2 different GPSr taken at the same time (so with the same dates) and it works perfectly fine : the best position is taken between the 2 tracks. So, it looks really ok for me ! Thanks a lot Gilles !
ok. Thanks for the report Fabien. I close this file now. Gilles Caulier