Bonjour,
Cette discussion m'a donné envie de creuser mes fichiers gps.
Pour ma part, le fichier se présente comme ceci :
Je souhaiterais récupérer par exemple distance ou temp mais j'ai beau faire de multiples essais, je n'y parviens pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 <?xml version="1.0" encoding="utf-8" standalone="no"?> <gpx version="1.1" creator="Movescount - http://www.movescount.com" 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.cluetrust.com/XML/GPXDATA/1/0 http://www.cluetrust.com/Schemas/gpxdata10.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd" xmlns:gpxdata="http://www.cluetrust.com/XML/GPXDATA/1/0" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns="http://www.topografix.com/GPX/1/1"> <trk> <name>Move</name> <trkseg> <trkpt lat="47.381935" lon="-2.957072"> <ele>-1</ele> <time>2018-08-07T14:15:25.000Z</time> <extensions> <gpxdata:temp>26.7000007629395</gpxdata:temp> <gpxdata:seaLevelPressure>1008</gpxdata:seaLevelPressure> <gpxdata:speed>0.800000011920929</gpxdata:speed> <gpxdata:verticalSpeed>0</gpxdata:verticalSpeed> </extensions> </trkpt> <trkpt lat="47.381925" lon="-2.95708"> <ele>9</ele> <time>2018-08-07T14:15:27.000Z</time> <extensions> <gpxdata:temp>26.7000007629395</gpxdata:temp> <gpxdata:altitude>9</gpxdata:altitude> <gpxdata:seaLevelPressure>1008</gpxdata:seaLevelPressure> <gpxdata:speed>0.800000011920929</gpxdata:speed> <gpxdata:verticalSpeed>0</gpxdata:verticalSpeed> </extensions> </trkpt> <trkpt lat="47.38191" lon="-2.957064"> <ele>9</ele> <time>2018-08-07T14:15:30.000Z</time> <extensions> <gpxdata:temp>26.3699992480917</gpxdata:temp> <gpxdata:distance>4</gpxdata:distance> <gpxdata:altitude>9</gpxdata:altitude> <gpxdata:seaLevelPressure>1008</gpxdata:seaLevelPressure> <gpxdata:speed>0.800000011920929</gpxdata:speed> <gpxdata:verticalSpeed>0</gpxdata:verticalSpeed> </extensions> </trkpt> ....
J'obtiens des listes vides, des NoneType, ...
J'ai essayé de voir avec la doc de xml.etree.ElementTree mais sans succès.
Partager