avp2wpt

About

avp2wpt is a GPS related java utility. It takes a GPS trace file (in .gpx format) as input,
scans a folder for files of a given extention (typically, audio, video or photo files),
and outputs the results as another .gpx file, containing the corresponding waypoints.
This waypoints file can then be read by a gpx-aware application, which will show the trace and play the media files.

Java 5 is required to run avp2wpt. This program was made using Eclipse and the JDOM library. Without these great tools, avp2pt would not have been possible (program was first released just 10 days after I started to learn Java).

History

0.1.0 aug 26, 2009 First beta.
0.1.1aug 28, 2009- Fixed a bug when no extention was specified : array out of bounds.
- Fixed a bug when no waypoint was found : bogus file was created.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public license as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Syntax

Usage : avp2wpt <FilePath> <ext> [options...]
<FilePath> : > : Path of gpx trace file to be parsed.
<ext> : extention of files to treat as waypoints (ie. avi, wav, jpg...).
[options...] :
         -v : verbose
         -s : time shift in minutes
         -h : help
Arguments are not case-sensitive.
Verbose displays all details, used for debugging.
Time shift represents the difference between your local (files timestamps) time, and your GPS (UTC) time.

Error codes :
0 : no error
1 : no argument
2 : File not found

Exemple

For this example we will do a short survey around the block, making a gpx trace, two pictures and a voice note :
    20090826-145102.gpx
    DSC00035.JPG
    DSC00036.JPG
    Enregistrement.amr
With all 4 files in the same folder as avp2wpt.jar, we issue the commands :
    java -jar avp2wpt.jar 20090826-145102.gpx jpg -s120
to get
    Reading 20090826-145102.gpx
    Converting...................................................
    51 points read from file.
    First point : Wed Aug 26 14:51:04 CEST 2009
    Last point : Wed Aug 26 14:57:14 CEST 2009
    Scanning jpg files...
    2 waypoints found.
    20090826-145102-jpg.gpx written.
and
    java -jar avp2wpt.jar 20090826-145102.gpx amr -s120
to get
    Reading 20090826-145102.gpx
    Converting...................................................
    51 points read from file.
    First point : Wed Aug 26 14:51:04 CEST 2009
    Last point : Wed Aug 26 14:57:14 CEST 2009
    Scanning jpg files...
    1 waypoints found.
    20090826-145102-amr.gpx written.

Note that my device (Sony Erisson K530i) records sound as .amr files.
This is not an issue, any file type can be treated as a waypoint marker.
Just make sure that it can be read by your system. I installed an amr codec for Windows.
If you have to preprocess the files, take care that timestamps *must* be preserved.

Now we have 2 more files in our folder :
    20090826-145102.gpx
    20090826-145102-jpg.gpx
    20090826-145102-amr.gpx
    DSC00035.JPG
    DSC00036.JPG
    Enregistrement.amr

We will open all 3 .gpx files in JOSM editor :
Waypoints in JOSM

Et voilą : if we click on a waypoint marker, JOSM spawns our usual viewer/media player, using system settings.

To do

- Currently, avp2wpt assigns each waypoint to the closest trace point next after the file's timestamp.
If points are recorded quite far from one another, this can cause mistakes. I wish to implement some kind of interpolation.

- Maybe it would be better if the program added waypoints inside the same file, instead of creating new files. But there is risk of creating duplicated points. Program should warn the user if existing waypoints are found. Use -f option to force adding.

Download

Latest stable with sources : avp2wpt011.zip

Feedback

about comments, suggestions or bug reports.