Back from our vacation in the Bavarian Forest, I noticed that my long-serving and really reliable iBlue 747A+ GPS logger apparently stopped working: it delivered tracks with a date around year 2000. Investigating this further, I found that the time appeared to be okay, but the date was completely wrong.
Fortunately, the device isn't broken, it was just hit by the GPS Week Number Rollover, that took place on 2019-04-07. This really sucks! But blessedly, I can continue using the logger. One can fix the wrong date by adding 172,032 hours to the date (that is: 1024 weeks times 7 days times 24 hours).
This can be done via gpsbabel in the following way (assuming we have a GPX encoded GPS data file):
Hopefully, Europe's Galileo GNSS won't suffer from such shortcomings and my next "GPS" logger will use this one … and the good ole' one will continue working a few years until Galileo is finished, working and a lot of devices support it ;-)
This Levenshtein Distance function seems to be quite nicely optimized to me (an amateur programmer), as it does not calculate the whole comparison matrix, but only keeps the last column:
int levenshteinDistance(const QString &source, const QString &target){// Mostly stolen from https://qgis.org/api/2.14/qgsstringutils_8cpp_source.htmlif(source == target){return0;}constint sourceCount = source.count();constint targetCount = target.count();if(source.isEmpty()){return targetCount;}if(target.isEmpty()){return sourceCount;}if(sourceCount > targetCount){return levenshteinDistance(target, source);}
QVector<int> column;
column.fill(0, targetCount +1);
QVector<int> previousColumn;
previousColumn.reserve(targetCount +1);for(int i =0; i < targetCount +1; i++){
previousColumn.append(i);}for(int i =0; i < sourceCount; i++){
column[0]= i +1;for(int j =0; j < targetCount; j++){
column[j +1]= std::min({1+ column.at(j),
1+ previousColumn.at(1+ j),
previousColumn.at(j)+((source.at(i)== target.at(j))?0:1)});}
column.swap(previousColumn);}return previousColumn.at(targetCount);}
And here's the one for the Longest Common Subsequence, to be used for diff-like comparing of two QStrings and generation of a visible representation of their differences:
Believe it or not: My statistical ("Bayesian") spam filter b8 has a new release! The last one dates back to 2014, but the reason was not that it wasn't developed anymore, but that there simply were no bugs or wishes since ;-)
Apart from some code formatting and cleanup, the only thing changed is the removal of the as of PHP 7.2 deprecated each() function. Version 0.6.2 should now run without deprecation warnings.
Everything else stayed the same, so version 0.6.2 can simply replace it's predecessor without any change (supposed you at least used version 0.6 in which the database format has been changed the last time).
Quite some time has passed since the last release of gpx2svg, the program to convert GPX to SVG, but thanks to Emiel Brommer, there's a new release now.
The problem was that some GPS devices create a lot of segments that don't overlap by their first and last point. Thus, the default segment combining algorithm of gpx2svg is not able to detect them and the output is scattered in a lot of paths.
The new -j command line switch turns off the default combining and creates one big segment with all data in it, in the (chronological) order given by the GPX file. This, of course, will only produce a meaningful result if the order is correct, but in these cases, we do get one.
Thanks again to Emiel for supplying the initial patch! Have a lot of fun with gpx2svg!