Track declares and exposes name, comment, description, number and type, but ReadGpxXml in src/cpp/fastgpx/fastgpx.cpp only reads <metadata><name>, <trkseg> and <trkpt>. The <trk> children are never visited, so from Python these attributes are always None.
gpx = fastgpx.load("gpx/test/two-points.gpx")
gpx.tracks[0].name # None, even when <trk><name> is present
The README example prints track.name, so users will expect this to work.
Suggested fix: read <name>, <cmt>, <desc>, <number> and <type> in the <trk> loop. This is a handful of child() lookups per track, so it does not affect the per-point cost. Note that gpx.name returns '' for an empty <name></name> while a missing element gives None; the same convention should apply to tracks.
Found in the code analysis session; see the other code-analysis issues for related findings.
Trackdeclares and exposesname,comment,description,numberandtype, butReadGpxXmlinsrc/cpp/fastgpx/fastgpx.cpponly reads<metadata><name>,<trkseg>and<trkpt>. The<trk>children are never visited, so from Python these attributes are alwaysNone.The README example prints
track.name, so users will expect this to work.Suggested fix: read
<name>,<cmt>,<desc>,<number>and<type>in the<trk>loop. This is a handful ofchild()lookups per track, so it does not affect the per-point cost. Note thatgpx.namereturns''for an empty<name></name>while a missing element givesNone; the same convention should apply to tracks.Found in the code analysis session; see the other
code-analysisissues for related findings.