You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that the default list of xsi:schemaLocation is generated after calling gpx.to_xml(). That is why the list can neither be appended nor extended before the call.
I think it would be nice to check if schema_locations of topografix are given when 'to_xml()' is called.
For example, in the code of def to_xml() in gpx.py (lines from 2698, version 1.4.2):
default_schema_locations = [
p.format(version_path) for p in (
'http://www.topografix.com/GPX/{0}',
'http://www.topografix.com/GPX/{0}/gpx.xsd',
)
]
if not set(self.schema_locations) >= set(default_schema_locations):
self.schema_locations = default_schema_locations + self.schema_locations
I am very new to gpxpy and want to have a gpx file similar to those from Garmin. The xsi:schemaLocation should be looked like this:
The following script generates the first two of the above mentioned schemaLocation.
However, appending the rest to the list of schema_locations fails. It generates only the list of the added four.
Is this an intentional behaviour that the list cannot be appended?
We can, of course, write the complete list like this.
I am using Python 3.6 and gpxpy 1.4.2.
The text was updated successfully, but these errors were encountered: