mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
80bb06c84f
A list could leave the instance as a TREK file, which only another TREK reads. Export now asks for a format, and GPX is the second one: the places as waypoints, for OsmAnd, Organic Maps, a Garmin or gpx.studio. Import takes a GPX in the same dialog as a list file. Asked for in discussion #2301. The GPX is written from the very list file the JSON export returns, so what may leave the instance is still decided in one place. Name, description and address, notes, website and category go into GPX's own elements, where every app shows them. Labels, status, phone and the rest travel in a TREK extension namespace, so a GPX made by TREK comes back as the same list. A place without coordinates cannot be a waypoint; it is left out and the export says how many were. A GPX is read on the server, sent as text, with the XML library the trip importer already uses. A document with a DOCTYPE is refused before parsing, which closes both external entities and entity expansion. Size is capped like the list file, and the element count is capped before a tree is built. The reader only turns the GPX into a list file: the browser previews it and imports it through the existing route, so one contract, one transaction and one skipped counter cover both formats. Waypoints and named route points become places; tracks and unnamed route points are counted in the preview and not imported. The two list-file routes get a body ceiling of twice the file limit. The global 100 kB cap refused most real favourites files, and it already refused list files well under the megabyte the contract allows.
37 lines
1.8 KiB
XML
37 lines
1.8 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www8.garmin.com/xmlschemas/TrackPointExtensionv1.xsd" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpxpx="http://www.garmin.com/xmlschemas/PowerExtension/v1" creator="https://gpx.studio" version="1.1">
|
|
<metadata>
|
|
<name>Sintra loop</name>
|
|
<author>
|
|
<name>gpx.studio</name>
|
|
<link href="https://gpx.studio"></link>
|
|
</author>
|
|
</metadata>
|
|
<wpt lat="38.787636" lon="-9.390587">
|
|
<ele>412.3</ele>
|
|
<name>Pena Palace</name>
|
|
<desc>Book the palace interior online, the park is walk-in</desc>
|
|
<sym>Flag, Blue</sym>
|
|
</wpt>
|
|
<wpt lat="38.792558" lon="-9.389433">
|
|
<ele>398.0</ele>
|
|
<name>Moorish Castle</name>
|
|
</wpt>
|
|
<trk>
|
|
<name>Sintra loop</name>
|
|
<type>Hiking</type>
|
|
<trkseg>
|
|
<trkpt lat="38.797642" lon="-9.388412"><ele>207.4</ele></trkpt>
|
|
<trkpt lat="38.795131" lon="-9.389120"><ele>256.9</ele></trkpt>
|
|
<trkpt lat="38.793880" lon="-9.389664"><ele>301.2</ele></trkpt>
|
|
<trkpt lat="38.792558" lon="-9.389433"><ele>398.0</ele></trkpt>
|
|
<trkpt lat="38.790412" lon="-9.389981"><ele>421.6</ele></trkpt>
|
|
<trkpt lat="38.787636" lon="-9.390587"><ele>412.3</ele></trkpt>
|
|
</trkseg>
|
|
<trkseg>
|
|
<trkpt lat="38.786201" lon="-9.392110"><ele>388.0</ele><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>19</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt>
|
|
<trkpt lat="38.790977" lon="-9.396511"><ele>331.5</ele></trkpt>
|
|
</trkseg>
|
|
</trk>
|
|
</gpx>
|