tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
987 stars 223 forks source link

metadata error in bounds #246

Closed ealaz closed 2 years ago

ealaz commented 2 years ago

The metadata does not result in a valid xml file. Most codes will tolerate this but some (Garmin Homeport) will not, TYhe error is in bounds which has added space (linefeed). It can be corrected by modifying gpxfield.py as follows to remove the offending space & linefeed. if tag: if tag == 'bounds': if tag_open: body.append('>') body.append('</' + tag + '>')

print("tag,body:",tag,'\t',body)

    else:
        if tag_open:
            body.append('>')
        body.append('\n' + indent + '</' + tag + '>')

It is inelegant but it works.

tkrajina commented 2 years ago

https://github.com/tkrajina/gpxpy/issues/186