gpsbabel
gpsbabel copied to clipboard
When converting to fit format, a name should be generated if there's none in the original format
It looks like fit files have a name inside them. At least some devices delete fit
-files if that is not set.
Therefore, in the case the original file does not have a corresponding value I suggest to generate one, e.g. from the filename (maybe discarding the extension)
gpx files can have a name
tag directly below the gpx
root.
When I convert such a file to fit
and put it on my garmin watch, the watch deletes the file. This should be avoided, hence the suggested workaround.
Our writers have no idea where any given data element comes from as it may have been filtered, merged, interpolated, etc. So the GPX
However, we have about a bazillion "name" things in our formats and code. By inspection (I don't think any of my 100+ GPSes do .fit) the only thing that catches my eye as possibly funny is that here: [garmin_fit](https://github.com/GPSBabel/gpsbabel/blob/29b154f81bad73cf9dd8da07b4f92fdb3ebd361e/garmin_fit.cc
We use the name of the first route we see (which, in GPX parlance would be a
Maybe it would be better to not write an empty string? Maybe we need some kind of rte->rte_name.isEmpty() ? "default" : rte->rte_name to just write SOMETHING there. If that basically fixes it, we can figure out how we can clean the output name (which might be usb:: or \share\some\long\name or file:\\c:\some\name or have unsavory punctuation or something, but let's figure out if just writing something is better than writing nothing. Or, if testing that we have nothing and not wrting that at all is better.
Since you have the test case and the affected hardware, it'll probably be up to you to do the experimentation.
Writers can see session information. In the common use case of one input file I think we should be able to recover the input file name.
It isn't clear to that the name in the course message is what the OP needs on his watch.