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

fix bugs with gpx passthrough. #1197

Merged
merged 1 commit into from
Oct 26, 2023
Merged

fix bugs with gpx passthrough. #1197

merged 1 commit into from
Oct 26, 2023

Conversation

tsteven4
Copy link
Collaborator

These bugs exist for gpx 1.0 -> gpx 1.0 passthrough, and gpx 1.1 to gpx 1.1 passthrough. This work does not consider passthrough between different versions(#1194).

with gpx 1.0, any extension data that was a child of rte or trk was lost. I believe this used to work but has been broken for quite a while.

with gpx 1.0 extension data that was a child of gpx could be erroneously rewritten as part of the final wpt/rtept/trkpt.

with gpx 1.1 extension data that was a child of trkseg could be erroneously rewritten as part of the final wpt/rtept/trkpt.

with gpx 1.1 extension data that was a child of gpx could be erroneously rewritten as part of the final wpt/rtept/trkpt.

with gpx 1.1 extension data that was a child of waypoint and passed through would result in a schema violation, the required extension element was lost.

I note we currently drop any extension data that is a child of gpx, ,a child of trkseg, or a child of metadata.

with gpx 1.0, any extension data that was a child of rte or trk
was lost.  I beleive this used to work but has been broken for quite
a while.

with gpx 1.0 extension data that was a child of gpx could be
erroneously rewritten as part of the final wpt/rtept/trkpt.

with gpx 1.1 extension data that was a chile of trkseg could be
erroneously rewritten as part of the final wpt/rtept/trkpt.

I note we currently drop any extension data that is a child of gpx,
,a child of trkseg, or a child of metadata.
@tsteven4
Copy link
Collaborator Author

Bug demo. This runs the new test against the code without the fix to gpx.cc (from c668916)

Running gpx.test
--- ./reference/gpxpassthrough10~gpx.gpx        2023-10-26 13:48:02.152519577 -0600
+++ /tmp/gpsbabel.56238/gpxpassthrough10~gpx.gpx        2023-10-26 13:48:22.840263458 -0600
@@ -24,7 +24,6 @@
   <rte>
     <name>Low Road</name>
     <desc>Generated from track Route</desc>
-    <foreign:something>rte</foreign:something>
     <rtept lat="36.339560000" lon="-117.422570000">
       <ele>479.300</ele>
       <name>RPT001</name>
@@ -41,7 +40,6 @@
   </rte>
   <trk>
     <name>meridian</name>
-    <foreign:something>trk</foreign:something>
     <trkseg>
       <trkpt lat="30.062183333" lon="-91.610350000">
         <ele>1.000</ele>
@@ -55,6 +53,7 @@
       <trkpt lat="30.062700000" lon="-91.608266667">
         <ele>0.000</ele>
         <time>2002-05-25T17:12:00.200Z</time>
+        <foreign:something>eof</foreign:something>
       </trkpt>
     </trkseg>
   </trk>
ERROR comparing ./reference/gpxpassthrough10~gpx.gpx /tmp/gpsbabel.56238/gpxpassthrough10~gpx.gpx
--- ./reference/gpxpassthrough11~gpx.gpx        2023-10-26 13:48:02.152519577 -0600
+++ /tmp/gpsbabel.56238/gpxpassthrough11~gpx.gpx        2023-10-26 13:48:22.850277205 -0600
@@ -15,9 +15,7 @@
     <name>Turn right at Airport Rd</name>
     <cmt>Turn right at Airport Rd</cmt>
     <desc>Turn right at Airport Rd</desc>
-    <extensions>
       <foreign:something>wpt</foreign:something>
-    </extensions>
   </wpt>
   <wpt lat="36.463640000" lon="-116.879200000">
     <ele>-67.300</ele>
@@ -67,6 +65,12 @@
       <trkpt lat="30.062700000" lon="-91.608266667">
         <ele>0.000</ele>
         <time>2002-05-25T17:12:00.200Z</time>
+        <extensions>
+          <foreign:something>trkseg</foreign:something>
+        </extensions>
+        <extensions>
+          <foreign:something>eof</foreign:something>
+        </extensions>
       </trkpt>
     </trkseg>
   </trk>
ERROR comparing ./reference/gpxpassthrough11~gpx.gpx /tmp/gpsbabel.56238/gpxpassthrough11~gpx.gpx

@tsteven4
Copy link
Collaborator Author

All the new reference files have been validated against all used schema.

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.03% 73.33%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c668916) 23104 15989 69.21%
Head commit (02d5925) 23115 (+11) 16003 (+14) 69.23% (+0.03%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1197) 45 33 73.33%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@tsteven4 tsteven4 merged commit 0b19dda into master Oct 26, 2023
37 checks passed
@tsteven4 tsteven4 deleted the gpxpassthroughtest branch October 26, 2023 23:24
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.

2 participants