... the user friendly GPS tool


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
extracting waypoints only from command line or API
#1
I want to extract the waypoints from a very large number of small gpx and kml files into csv with traceability of the origin of each waypoint. I do not mind whether i get one output file per input or whether everything is lumped into the same output with a source indication added.

gpsbabel crashes when I request the batch mode to do this, despite multiple attempts. Processing each file individually by reloading babel for each file is very slow (my application has to run as a subprocess of another program running on Windows, so parallel makes are not an option).

Looking for alternatives I have just discovered RouteConverter and find it quite sexy! It seems that running RouteConverterCmdLine.jar, from jshell would be far more convenient and versatile than dealing with the idiosyncracies of gpsbabel, which is starting to look like legacy software, and this despite my java skills being very basic and rusty.


Running a full extraction of the file contents is easy and fast, I pipe in my initialization (log4j setup possibly broken in this extract):

Code:
/env -class-path C:/Users/.../RouteConverterCmdLine.jar:C:/Users/.../log4j-core-3.0.0-alpha1.jar
import slash.navigation.converter.cmdline.RouteConverterCmdLine
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

and then keep piping infor each file I want converted:

Code:
RouteConverterCmdLine.main( new String[]{"12345678.gpx", "CsvCommaFormat", "12345678.csv"});
/reload -restore

I have pulled the source code from github and browsed it, but cannot find the entry point for dealing with waypoints only and eliminating routes and tracks.
what would be a good entry point?
Reply
#2
(04.04.2025, 11:24)PhilipButler Wrote: Looking for alternatives I have just discovered RouteConverter and find it quite sexy!

That's nice. Thank you!

(04.04.2025, 11:24)PhilipButler Wrote: I have pulled the source code from github and browsed it, but cannot find the entry point for dealing with waypoints only and eliminating routes and tracks.
what would be a good entry point?

I'd start with looking at RouteConverterCmdLine#convert and inserting your magic there between reading and writing of the data with the NavigationFormatParser. And clone the repo for easier navigation in the IDE.
--
Christian
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)