Forum: Misc. GPS Equipment Information
Topic: New Linux Geocaching program/Format question
started by: ocm_ott

Posted by ocm_ott on June 21 2010,9:32 am
Hi:

I'm writing a new Geocaching program for Linux (http://sourceforge.net/projects/opencachemanage/). At the moment I don't have Navicache support, but I'm planning to add it.

Question for the users here: Is Navicache's XML format popular? Navicache's GPX files are fairly sparse, and GPSS files are hard to parse, so I'm looking at the XML format to provide paperless caching.

Posted by DudleyGrunt on June 21 2010,10:35 am
Agree with the sparseness of the NC GPX files.  I do most of my NC loading by hand, because of that and since I do try to filter out crosslisted caches.

Apart from PC Medic (site admin), KFL has done some work with the XML here for a project he was working on.  He might have input.

I saw your note on TerraCaching, too.  Look forward to hearing about your progress.

Posted by KFL on June 21 2010,8:37 pm
That's very interesting. C# is not really what I would prefer and I wonder if there are associated command line tools, but I will give it a try and let you know.
I almost started a similar project a while back but life was in its way so far. I would probably have used python with wx-bindings to have the whole program including gui trivially platform independent.

For navicache: the xml seems to be the probably best way to obtain the cache data from this site. The API is pretty basic, but the most important part is that you can request every change since a certain time. That means you do not have to (and should not) download the entire database each time you update your local copy. I would definitely go for the xml data and urge PCMedic to fix issues if there are any (I cannot quite remember).

I use these data currently to have an interactive map of navicaches, much like the geocaching-map that groundspeak has (but not quite as nice-looking or feature-rich). It's basically an openstreetmap.org map with navicaches overlayed as waypoints, clickable to open an inlay with basic information and a link to the cache page.

Posted by ocm_ott on June 22 2010,5:33 am
I know C#/Mono is a bit controversial in Linux circles, but in my day job I code in Java across about 16 different unix OS's and C# on Windows, my C/C++ skills are rusty, and I hardly ever touch Python. Mono allowed me to be a little more OS specific then Java, and I really wanted to learn how to do GTK (using the gtk-sharp bindings) so it's what I chose. I'm actually not planning on doing cross-platform support, which makes me using C# a little ironic :)

What kind of command line tools would you want? It's an interesting idea. The other option is since I'm using a SQLLite DB you can probably write things to query the OCM DB directly (though the schema will be changing frequently at this early stage)



Posted by ocm_ott on June 22 2010,7:06 am
Another general Navicache question for OCM...

How would people prefer cross-posted caches to be handled? One option is that you just see the gc.com and navicache in the list as two entries that happen to have the same coordinate (no work on my part). I could go a little farther and flag caches that seem to be cross-posted (I think the only way I can tell is if the posted coordinates match) and let the user keep both entries or delete one or the other.

Navicache support will probably come in 0.16 (for XML). 0.15 will have support for the gpx and loc files that Navicache generates, and full support for TerraCache GPXs.

Posted by KFL on June 22 2010,7:33 am
I didn't use python myself much before that. It's a nice reason to get to use it a bit more. I would usually do it in perl (that is what my current collection of scripts is made with), but I figured even though I don't use it, itwould be nice to have Windows support and perl with Windows seems to be more complicated than python and Windows.
I didn't choose a 'compiled' language because I believe that a scripting language is a better fit for the task. A lot of those tasks is pattern matching and simple gui. That is what those languages are made for.

My current set of scripts consists pretty much completely of command-line tools, mostly targeted towards gc.com. Some can update my local database with data in a given coordinate window (taken from the geocache-map), some take that and can send a notification email or text message for new caches (run as cronjob). Some simply grab a cache page, parse it and stuff the info in my local database. Others generate my geocache statistics (http://www.geocaching.com/profile/?guid=e8274ba1-9513-4547-b4f6-201dace88160). I don't use the first part so much anymore since I gave in and got the premium membership, but I keep it working.

It's pretty much all stitched together, without a big concept, which is why I wanted to start anew. It is also not using a 'real' database, and I intended to use sqlite as well next time.

As for cross-listed caches: as long as you keep the data local, the coordinate approach is pretty good. It doesn't catch all and there are false positives, but most are pretty accurate (I did that for my caches once).

What would be much better is a public data base of cross-listings. Such a database has the problem that is cannot contain cache information from gc.com, because that would be a violation of their terms. However, a simple 'table' with waypoint names corresponding to waypoint names of other sites could hardly violate their terms. In addition they cannot argue that this would publish information taken from their site, because that is exactly what they don't provide on their site.

The tricky part would be to let users build this database but keeping the impact of malicious users small. I cannot think of another mechanism than implementing something like a user trust value and votes for the correctness of an entry. That way both the trustworthiness of a user and of a cross-link could be shown. That is outside of the scope of the manager you write, but it could interface with such a service.

Posted by ocm_ott on June 22 2010,9:19 am
I'm trying to be very careful of not being close to violating their terms. I even sent them my icon set (since I'm not using their icons) and changed it to meet their approval.

Parsing XML in Java/C# is something that's also a very big part of my day job, going that route was automatic for me :)



Posted by KFL on June 22 2010,9:37 am
Quote (ocm_ott @ June 22 2010,10:19 am)
Parsing XML in Java/C# is something that's also a very big part of my day job, going that route was automatic for me :)

I guess everyone chooses the tools they are used to. :-)
Posted by KFL on June 22 2010,4:33 pm
Quote (ocm_ott @ June 22 2010,10:19 am)
I even sent them my icon set (since I'm not using their icons) and changed it to meet their approval.

I wonder what they didn't like with yours (not knowing it, but still).
Posted by ocm_ott on June 22 2010,7:26 pm
Too close to the official icons. My original icon was a green boxed lid, but still different then the official one. So changing the icon for a traditional cache to a blue boxed lid, rotated the other way met their approval. The earth cache icon was originally just the planet Earth, deemed to close so it's now an earth in a magnifying glass.

Speaking of slippy maps, is there a public one available for NaviCache? The OCM slippy map is actually using an embedded webkit (i.e. Safari/Chrome) browser and OpenLayers Javascript (another open source technology) to display interactive maps using either OSM or Google Maps (I can do Yahoo/Bing as well trivially, I dropped it though since I thought I was reaching map overload status). Someone might want to take it and run with it to do something completely web based.



Posted by KFL on June 22 2010,7:49 pm
Quote (ocm_ott @ June 22 2010,8:26 pm)
Speaking of slippy maps, is there a public one available for NaviCache? The OCM slippy map is actually using an embedded webkit (i.e. Safari/Chrome) browser and OpenLayers Javascript (another open source technology) to display interactive maps using either OSM or Google Maps (I can do Yahoo/Bing as well trivially, I dropped it though since I thought I was reaching map overload status). Someone might want to take it and run with it to do something completely web based.

I don't know what a slippy map is. Do you mean the javascript-based maps ala yahoo/google/openstreetmap? As I said I did one for navicache, based on OpenLayers, with openstreetmap as map source (which could, as you said, be trivially changed). It's complety web based, you are right. It is not what I would call user-friendly yet though, e.g. the caches are displayed unfiltered so far, with a lot of archived caches on the map. It's trivial to do, but I didn't find the time to do it yet.
Posted by ocm_ott on June 22 2010,8:22 pm
Yes, that's a slippy map.

Is your map online somewhere? Searching Navicache by the "Search For Caches" link is a little painful.

Posted by KFL on June 22 2010,9:41 pm
http://www.family-loeffler.net/frank/map.html

As I said: not really fully cooked yet with obvious possibilities to be improved.

Posted by ocm_ott on June 23 2010,5:17 am
This is excellent, thanks! I can start adding a few Navicaches (not many in my neck of the woods) to my todo list.

I see your using OpenLayers too. BTW, here's how you add a Google Map hybrid map layer. You might know this already, but I hit a few snags the first time that you can avoid if you haven't tried it yet. You used to need a developer key to do Google Maps, but they removed that restriction in April.

1) Include this line as a source script
<script src='http://maps.google.com/maps?file=api&v=3'>

2)  var ghyb = new OpenLayers.Layer.Google(
               "Google Hybrid",
               {'type': G_HYBRID_MAP, 'numZoomLevels':20, 'sphericalMercator': true}
           );
map.addLayer(ghyb);

That sphericalMercator line is very important. Google Maps and OSM use different map projections. Without that option, the markers will be in the wrong place when you switch from OSM to Google and vice-versa

Posted by KFL on June 23 2010,6:58 am
Quote (ocm_ott @ June 23 2010,6:17 am)
You used to need a developer key to do Google Maps, but they removed that restriction in April.

Oh, that's news for me. That was one of the main reasons I didn't use google maps as an option as well. I should go and look up their new terms, thanks for the information!
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.