Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consolidate handling of extensions in gpx writer. #1200

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

tsteven4
Copy link
Collaborator

This is a user visible change.

Previously if gARmIN sPECIAL dATA existed and both garminextensions and humminbirdextensions were false then the gpx writer would write a subset of it (and not passthrough any gpx -> gpx data.) If gARmIN sPECIAL dATA existed and either extension option was true, then a different subset would be written (and any gpx -> gpx data would not be passed through.) Now the garminextensions option must used to have any gARmIN sPECIAL dATA data written.

Previously, when passing through extension data from the gpx reader to the gpx writer, some elements of the garmin and humminbird extensions were not included. Now, all foreign elements are included. As before, passthrough is only used when both extension options are false.

This is a user visible change.

Previously if gARmIN sPECIAL dATA existed and both garminextensions
and humminbirdextensions were false then the gpx writer would
write a subset if it (and not passthrough any gpx -> gpx data.)
If gARmIN sPECIAL dATA existed and either extension option was true,
then a different subset would be written (and any gpx -> gpx data would
not be passed through.)  Now the garminextensions option must
used to have any gARmIN sPECIAL dATA data written.

Previously, when passing through extension data from the gpx reader to
the gpx writer, some elements of the garmin and humminbird extensions
were not included. Now, all foreign elements are included. As before,
passthrough is only used when both extension options are false.
@tsteven4
Copy link
Collaborator Author

@robertlipe are you ok with the user interface changes here? The mode where we found gmsd data and automatically wrote it is gone, it's either passthrough from gpx -> gpx of unknown extension data, or creation of extension data with the garminextension option now.

@GPSBabelDeveloper
Copy link
Collaborator

GPSBabelDeveloper commented Oct 29, 2023 via email

@tsteven4
Copy link
Collaborator Author

The answer is yes if you don't use -o,garminextensions, and no otherwise.

A related test is in garmin_gpi.test where we had to add the garminextensions option

-gpsbabel -i garmin_gpi -f ${REFERENCE}/umsonstdraussen.gpi -o gpx,gpxver=1.1 -F ${TMPDIR}/umsonstdraussen.gpx
+gpsbabel -i garmin_gpi -f ${REFERENCE}/umsonstdraussen.gpi -o gpx,garminextensions -F ${TMPDIR}/umsonstdraussen.gpx

which produces similar output. I understand the namespace declaration changes, but hidden in there we do handle a 0x1a substitute character differently.

@robertlipe
Copy link
Collaborator

robertlipe commented Oct 30, 2023 via email

@tsteven4
Copy link
Collaborator Author

I suspect umsonstdraussen.gpx was really generated when Qt didn't strip illegal characters in qxmlstreamwriter so we did in gpsbabel::xmlstreamawriter. We substituted a space. It looks like Qt just drops them. The writer does set error status after we write the text with the 0x1e character, but we aren't looking for the error, and indeed in this case we would want to ignore it.

@tsteven4 tsteven4 merged commit ab78834 into GPSBabel:master Oct 30, 2023
19 checks passed
@tsteven4 tsteven4 deleted the gpxextconsolidation branch October 30, 2023 00:35
@robertlipe
Copy link
Collaborator

robertlipe commented Oct 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants