The GPX module is a Geotools plugin to read, and eventually to write, Global Positioning System exchange (GPX) format files. The module implements a Geotools DataStore responsible for files with the .gpx extension. The module has been added to Geotools in the summer of 2007.

The GPX format

The GPS exchange format is an XML based file format used for data interchange by GPS consumer grade equipment and software. The core features of the GPX format are:

The coordinates are all stored as geographic coordinates related to the WGS84 coordinate referencing system. For example, a waypoint might be defined as:
<wpt lat="39.921055008" lon="3.054223107"/>.
The different structures described, which make up the "Data Dictionary", are limited to waypoints, which are point locations, tracks, which are ordered sequences of points, and routes, which are like tracks but differ conceptually: usually tracks are records of an actual journey and routes describe a potential itinerary.

Because the GPX format is file based, the format is not optimized for random access, that is the format can only be read and written linearly. The format therefore does not have the advantages of a database.

More information on this file format can be found on the GPX wikipedia page.

Module architecture

The module can be split into two distinct parts.

The first part of the module is independent of Geotools; this part parses the .gpx file and creates an in-memory representation. The module assumes that all GPX files can fit into memory since GPX files are generally used to describe short trips or excursions.

The second part of the module provides the actual interface to the Geotools library. This part defines:

Proposed packages

org.geotools.data.gpx

GeoTools interface implementations

org.geotools.data.gpx.memory

data beans and the file parser code

org.geotools.data.gpx.test

JUnit test cases

Design decisions

The initial implementation during the summer of 2007 provides a subset of the full possible functionality (providable by a DataStore, and the gpx format). Two main restrictions are that the DataStore is read only and the module only interprets waypoints and tracks. The module's development started as part of an other project, where fast development was more important than full functionality. Thats why the The following design issues in the initial implementation of the module, could be reconsidered:

Development directions

The module's development continues with the followings (not ordered):