Skip to content

Commit ea081c2

Browse files
committed
last version 1.2.8
0 parents  commit ea081c2

File tree

7 files changed

+861
-0
lines changed

7 files changed

+861
-0
lines changed

COMMENTS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The program was written to read xml data from
2+
GPS-tracks recorded with the app myTracks on
3+
Apples iPhone or iPad
4+
It can be used without any restrictions by everybody on PCs.
5+
A propagation to third parties is allowed.
6+
7+
developed in Swift, C++, python
8+
first version in Swift for macOS, now abandoned
9+
C++ Gnome GTK+ with gtkmm wrapper, October 2018
10+
last version in python Gnome with pyGTK, March 2021.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018-2021 Erich Küster
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# pyGTK-XML-data-from-GPS-Track-TreeView-with-ListStore
2+
Read XML data from a GPX file und display the GPS trackpoints in a meaningful table.</br>
3+
Calculates the total distance of the track by the Haversine formula for the great circle.</br>
4+
(python / Linux / Gnome / pyGTK / XML data / GPS track)
5+
6+
### Discussion
7+
This program is written in python with use of pyGtk for the Gnome GTK3 environment of Linux.
8+
9+
In those days when I switched from macOS to Fedora Linux (for what reasons ever), I had to change my programming language. For "simplicity" I choose first C++ and to my pleasure found its "way to think" very similar to Swift and Objective-C. Then I "meet" python and decided to switch the evaluated design from gtkmm to pyGtk which BTW is no problem.
10+
11+
Since Python is an interpretative language you can simply start the program in command line.
12+
13+
```
14+
# make it executable once
15+
chmod +x ./pyXMLGPX-parser.py
16+
./pyXMLGPX-parser.py
17+
```
18+
In the moment exists no localization or package preparation (on the TO-DO-list).
19+
20+
I wrote this program to become familiar with the GTK-API and to get a feeling how to display different widgets on the screen. For reading of XML files the python module <b>xml.etree.ElementTree</b> is used, which integrates itself trouble-free. Take the whole as example for handling treeviews on liststore base and reading of xml files under python GTK+.
21+
22+
### Background
23+
During trips by foot, bicycle or car I record the covered distance on my Apple iPhone or iPad with the excellent App <b>myTracks</b> by Dirk Stichling. Find more informations at [1] or [2].
24+
25+
The obtained GPX files are extracted from the backup files made by iTunes under macOS or Windows [3] and then transferred to my personal computer for dealing with further. To read in the file correctly into the program, you can do some changes:
26+
27+
```
28+
# delete the namespace prefix inside the data file and make a backup
29+
sed -e 's/mytracks://g' -i.backup gpxtrack-0.gpx
30+
# delete the attributes of the gpx node (complex regular expression code for sed)
31+
sed -e ':a;N;$!ba;s|\(.*<gpx\).*\(<trk>.*\)|\1>\2|' -i gpxtrack-0.gpx
32+
# the prefix `:a;N;$!ba;` is for adding of eventually existing linefeeds to the pattern space
33+
```
34+
With the newest version of the programm this is NOT necessary anymore ...
35+
36+
### Usage:
37+
The program is mostly self explaining. On the toolbar at top of the window you will find buttons for opening a xml file, leaving the program and getting info about. After opening a xml file the contained track points are displayed in a table together with the calculated speed between two points. The total covered distance is shown at the bottom of the window. Erasing and/or inserting additional points should not be difficult to implant just as storing of the modified file (but I leave that as your own task).
38+
39+
Simplified example of a xml file with GPS track data:
40+
41+
```
42+
<?xml version="1.0" encoding="UTF-8"?>
43+
<gpx>
44+
<trk>
45+
<name>2012-11-14 09:57:20</name>
46+
<extensions>
47+
<area showArea="no" areaDistance="0.000000"/>
48+
<directionArrows showDirectionArrows="yes"/>
49+
<sync syncPhotosOniPhone="no"/>
50+
<timezone offset="60"/>
51+
</extensions>
52+
<trkseg>
53+
<trkpt lat="51.30887235519598" lon="6.595192467799964">
54+
<ele>29.93182373046875</ele>
55+
<time>2012-11-14T09:17:41Z</time>
56+
<extensions>
57+
<speed>15.88389816914975</speed>
58+
<length>0.008501878652107393</length>
59+
</extensions>
60+
</trkpt>
61+
<trkpt lat="51.30883484617929" lon="6.59517176449913">
62+
<ele>30.09716796875</ele>
63+
<time>2012-11-14T09:17:42Z</time>
64+
<extensions>
65+
<speed>15.86182185803758</speed>
66+
<length>0.00441219393587493</length>
67+
</extensions>
68+
</trkpt>
69+
</trkseg>
70+
</trk>
71+
</gpx>
72+
```
73+
### Acknowledgements:
74+
- Special thanks go to the people in the developer community at StackOverflow. Without their help and answered questions at <https://stackoverflow.com/> and affiliate sites this work would not be possible.
75+
76+
### Literature
77+
[1] <https://www.mytracks4mac.info/index.php/en/> (english)</br>
78+
[2] <https://www.mytracks4mac.info/index.php/de/> (german)</br>
79+
[3] <https://github.com/ekuester/pyGTK-List-ManifestDB-From-iOSBackup.git>
80+
81+
### Disclaimer
82+
Use the program for what purpose you like, but hold in mind, that I will not be responsible for any harm it will cause to your hard- or software. It was your decision to use this piece of software.
83+

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.2.8

0 commit comments

Comments
 (0)