November 3, 2016

GPX files

Someday I would like to be able to import a GPX file into gtopo and have it plot an overlay as (perhaps) a red line, with waypoints displayed and labelled.

GPX is just a particular use of the XML format, so it should be possible to find a simple XML parser somewhere, or write some even simpler specific code to read GPX. Many commercial GPS gadgets will emit a GPX file. Here is a description of the GPX schema:

There are a variety of GPX related projects on GitHub.

KML files

You can convert a GPX file into a KML file and then feed the KML file to Google Earth, which works quite well. The GPX file can contain more information. The KML file is specifically intended to handle map markup.

Other tools

My friend Dave says he uses Caltopo and that it will import gpx or kml files (just like I want to do). It can output gpx or kml, so you can use it to translate one into the other.

The GPS babel program is open source (for linux) and will handle all kinds of conversion (or so I am told). Version 1.5.3 was available in November of 2016.

GTK overlay

Can GTK handle a transparent overlay layer? The Cairo Sinusoids example is instructive. It uses gtk3 (and I needed to install the gtk3-devel package before I could build it). It uses the gtk_overlay_new() call, which is apparently new to gtk3.

To run the perl clock you must install perl-Gtk2 (which pulls in perl-Glib) and then it works just fine.

GTK documentation

There are packages gtk2-devel-docs as well as gtk3-devel-docs to install. The documentation goes to /usr/share/doc/gtk2-devel-docs and has lots of examples. There is a lot there. The following are distributed with the devel-docs. The fairly outdates gtk+ 2.0 FAQ no longer seems to be available online, so you will have to point your browser at the link below. For the others, you are probably better served using the links above. There are lots of things under the gtk-doc directory.
file:///usr/share/doc/gtk2-devel-docs/faq/book1.html
file:///usr/share/doc/gtk2-devel-docs/tutorial/book1.html
file:///usr/share/gtk-doc/html/gtk2/index.html
file:///usr/share/gtk-doc/html/gtk3/index.html

Cairo itself is a vector graphics package that can be used outside of gtk.


Feedback? Questions? Drop me a line!

Gtopo / tom@mmto.org