+ZeroOne Posted November 19, 2011 Share Posted November 19, 2011 Greetings. I wrote a little Java program to parse caches from Groundspeak .gpx files into Java objects and then into a tab-delimited text file. In this format it is easy to explore cache data in, say, a spreadsheet program. The program and its source code are available as an MIT-licensed Google Code project. You can either checkout the source and compile it with Apache Ant, or you can just download the pre-compiled .jar file and run it with "java -jar GeoGPXParser.jar somefile.gpx" or "java -jar GeoGPXParser.jar some/directory/with/gpx/files". The output is written into caches.txt into the directory in which you executed the program. Let me know what you think of the program. It was made for my own needs but I figured someone else might find it useful as well and thus decided to publish it. So far it only distinguishes between traditional caches, multi-caches and mystery caches, grouping all the rest into a category called "Other", but for my purposes this was enough. Quote Link to comment
Keystone Posted November 19, 2011 Share Posted November 19, 2011 I am moving this thread from the Geocaching Topics forum to the GPS and Technology forum. Quote Link to comment
BoredRoom Posted December 5, 2011 Share Posted December 5, 2011 This looked promising, but this is what I get: C:\>java -jar GeoGPXParser.jar Exception in thread "main" java.lang.UnsupportedClassVersionError: geogpxparser/ GeoGPXParser : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: geogpxparser.GeoGPXParser. Program will exit. C:\>java -version java version "1.6.0_29" Java SE Runtime Environment (build 1.6.0_29-b11) Java HotSpot Client VM (build 20.4-b02, mixed mode, sharing) Quote Link to comment
+ZeroOne Posted December 5, 2011 Author Share Posted December 5, 2011 Hey, thanks for trying out my program! C:\>java -version java version "1.6.0_29" Java SE Runtime Environment (build 1.6.0_29-b11) Java HotSpot Client VM (build 20.4-b02, mixed mode, sharing)[/font] There's your problem: it's a Java 7 program. It is using some of those new tricks Java 7 provides and cannot be compiled or ran with Java 6, so you need to update your Java. Quote Link to comment
BoredRoom Posted December 5, 2011 Share Posted December 5, 2011 That seemed promising. I had to go to Oracle's website to get version 7 -- java.com doesn't host it yet. This is what I am getting now: C:\>java -jar GeoGPXParser.jar Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.getMainMethod(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.joda.time.ReadableInstant at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 6 more C:\>java -version java version "1.7.0_01" Java SE Runtime Environment (build 1.7.0_01-b08) Java HotSpot Client VM (build 21.1-b02, mixed mode, sharing) Quote Link to comment
+ZeroOne Posted December 5, 2011 Author Share Posted December 5, 2011 C:\>java -jar GeoGPXParser.jar Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant Oh, well, my bad. It doesn't find the lib\joda-time-2.0.jar file. For me it's there so I didn't come across that problem, although it should be obvious... Sorry. So try this: get the new distribution package, unzip it and try to run it like before. Let me know how that works for you. Quote Link to comment
BoredRoom Posted December 8, 2011 Share Posted December 8, 2011 Worked this time - thanks! The trick for making something foolproof is to find the right fool... Quote Link to comment
+ZeroOne Posted August 13, 2012 Author Share Posted August 13, 2012 (edited) Hello again! I learned about these kind of challenge caches where you have to find three different types of caches from ten different cache owners, or something similar. It didn't occur to me how you could check this easily using just the geocaching.com site, so I improved my own program. Download your My Finds Pocket Query and input it to my program, and you'll get an owners.txt file out. Open that in your favorite spreadsheet program, and you'll get a nice list of cache owners along with information on how many caches are theirs and what types of caches have they hidden. Edited August 13, 2012 by ZeroOne Quote Link to comment
+ZeroOne Posted October 23, 2013 Author Share Posted October 23, 2013 I have still been updating my application and since the last message it has been moved from an SVN repository in Google Code to a Mercurial repository in Bitbucket. A readily compiled binary is still available for download, in addition to the source code. The application can now, for example, output its results as HTML pages instead of only some .txt files. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.