GPSBabel: convert, manipulate, and transfer data from GPS programs or GPS receivers. Open Source and supported on MacOS, Windows, Linux, and more. Pointy clicky GUI or a command line version...
The gpx reader saves gpx 1.0 "global" data and gpx 1.1 metadata. If this saved data exists the gpx writer uses it, i.e. it forwards it from the input to the output.
The gpx 1.0 "global" data is
Note that maxOccurs is not specified, so the default value of 1 is used. These elements cannot be repeated in valid gpx 1.0.
The gpx 1.1 metadata is
The only element that can be repeated is link.
We don't currently handle gpx 1.1 metadata elements author, copyright, link, and extensions. These elements have more complicated content that simple text.
It appears that the gpx_global_entry queues are unnecessarily complicated in that they aren't used for anything that can legally exist more than once. If we handled gpx 1.1 metadata link elements then a solution that could track multiple occurrences of an element would be needed.
gpx_write_gdata concatenates element content from multiple illegally repeated elements in the input into one element in the output. While this will make the output valid it seems to be nonsensical to me. It does this for all the handled elements except url and email, in those cases it uses the content from the first occurrence.
I have modifications that replace these queues with QStringLists, but given the above concerns I question if we want to continue to handle invalid input in this manner. It would be simplest to just use the values from the last occurrence of the illegally repeated element and silent ignore the others. However, if the current behavior is desired I have duplicated it. Or is there another explanation for the state of the current code?
My modifications do not add support for the currently ignored gpx 1.1 metadata elements author, copyright, link, and extensions.
The gpx reader saves gpx 1.0 "global" data and gpx 1.1 metadata. If this saved data exists the gpx writer uses it, i.e. it forwards it from the input to the output.
The gpx 1.0 "global" data is
Note that maxOccurs is not specified, so the default value of 1 is used. These elements cannot be repeated in valid gpx 1.0.
The gpx 1.1 metadata is
The only element that can be repeated is link.
We don't currently handle gpx 1.1 metadata elements author, copyright, link, and extensions. These elements have more complicated content that simple text.
It appears that the gpx_global_entry queues are unnecessarily complicated in that they aren't used for anything that can legally exist more than once. If we handled gpx 1.1 metadata link elements then a solution that could track multiple occurrences of an element would be needed.
gpx_write_gdata concatenates element content from multiple illegally repeated elements in the input into one element in the output. While this will make the output valid it seems to be nonsensical to me. It does this for all the handled elements except url and email, in those cases it uses the content from the first occurrence.
I have modifications that replace these queues with QStringLists, but given the above concerns I question if we want to continue to handle invalid input in this manner. It would be simplest to just use the values from the last occurrence of the illegally repeated element and silent ignore the others. However, if the current behavior is desired I have duplicated it. Or is there another explanation for the state of the current code?
My modifications do not add support for the currently ignored gpx 1.1 metadata elements author, copyright, link, and extensions.