Cache raid

From GeoWiki
Jump to: navigation, search
Geocaching Australia
This page contains information specific to Geocaching Australia.

How to create a raid

You can create a My Query by heading to your My Query page. Select your criteria. e.g. 50 caches that are traditional that I don't own, haven't found, are available with a terrain <= 2 and difficulty <= 2, etc, etc, etc and centered on the cache in the middle of the area you are looking to raid by using the waypoint code in the Sort by Closest to field. It's probably preferable to check the raid area in the Google Maps option to check that the caches you think are going to be returned are indeed being returned. I suggest you restrict the number of caches returned to around 50. Only the 25 closest to the centre point that can be routed will be used in the calculation of the route. If you specify 100 or 1,000, you'll just waste CPU cycles at your end getting data that will be ultimately discarded. Once your query is perfected, click on the Raid link to get your route.

Background and Technical Limitations

Have you spotted an area that looks like it would be good to hit on a cache raid but you despaired as to how to get around the area in the fastest time and least distance? No? Well then you're not a real cacher :-) Oh, OK, you've changed your answer to yes? Excellent, then Geocaching Australia have a tool coming soon that is just for you. Actually, not just for you, for anyone, but it makes you feel better if I say it's just for you. Doesn't it?

The Cache Raider tool uses a My Query to generate a list of 25 caches by proximity to your defined starting point and will then create a map and driving directions to get to the caches in the fastest possible time in the least possible distance. You can see the driving directions and estimates times / distance by scrolling down the page when it's finished.

The cache raider is not the perfect optimal route, but I tell you what, it's pretty darn close. For the full disclosure of why 25 caches cannot be defined as an optimal route I'll let you do some reading [here]. Yes, that's where the code originated. It's called the Travelling Salesman Problem and the code from that site is available under a Common Public License version 1.0. Geocaching Australia have modified the code somewhat but it's pretty close, functionally, to the original.

25 caches? Why so few?

Directions, distance and timing from the Google Maps API is restricted to 25 caches per call. Google will return a failure if you try and use a number larger than 25. They're quite picky about people swamping their servers with unreasonable requests. With access to the AP free I understand their restrictions.

Unfortunately this means you cannot get a cache raid for something like the whole of Adelaide. If I understand the maths (which I won't say I do 100%), the number of possible options in a 300 cache, 24 hour raid would be (300-1)! or in other words 299 factorial or 299*298*297* ... 3*2*1. This is an almost impossibly large number and would take more computing power than you have to make this run in anything less than days, possibly weeks or even months. How big a number? 3.06... x 10^614. That's a pretty seriously large number. By the way, when people are making up cache raids by using paper maps and other tools, they are obviously not actually calculating all of those possibilities as they aren't always taking into account the travel time from a cache 10km from the centre of the CDB then another 10km North, then 10km South, but I tell you what, they are probably doing a of deal of calculating and automatic discarding in their heads. Now you know why it takes months of planning to come up with a good cache route to go on a raid.

Now, what do I mean by "that can be routed"? Some lat/lon locations that are provided to the Google Maps API cannot be routed. Caches that are far from a road cannot be routed to as the API cannot work out where the closest street location is. Other gotchas (that I found in testing) are caches that may be in the middle of a laneway in the centre of the CBD. The API will quite happily create a walking route, but they won't create a driving route. You can't create a joint walking / driving route, so basically if the API can't calculate a driving route to a cache, it is not included in the final route. This is why you may notice that some caches which are in the middle of your raid are not routed to.

Further to the intricacies of creating routes, etc, the raider also needs to take into account that if you call the API too fast for routing directions, Google Maps spits back an error at you as it thinks you're in breach of the access restrictions limiting you to a reasonable number of queries per day. To avoid running into this timer limit, we get confirmed routable locations in sequential order. i.e. When one route comes back, we fire off the next one. You can actually call the API asynchronously but this runs into the timer error more often that not, so unfortunately this means the access time for the routable locations is slower than we would like, but pretty much guarantees it will work.

Other technical limitations are for a particular API key (which has 1) and your own IP address; you can only get 15,000 route access per day. This means at some point if abuse the system the API will shut down on you. As the route is not optimal, refreshing the page will more than likely (almost 100% likely) to produce a slightly different route to the caches. Testing indicates that the differences in routes may be +/- 10% of the time and distance to travel. i.e. If you have a route that suggests it will be 2 hours and 120km, getting a different route may be between 1hr 28min / 108km and 2hr 12min / 132km. This is not (statistically) significantly different as you will need time to park, get out of your car, find the cache, get back in your car, etc, etc. If you do want to check different routes, I recommend opening a new browser window and running the new raid in that. Then you can check the time / distance between windows and choose the one that you consider best.

When it comes to how long the raid will take to run, it really depends on your machine and what browser you use. Internet Explorer seems to have the worst javascript engine which means it takes a lotlonger to get the details and render them on the screen. Possibly in the order ofa couple of minutes from the time you push the button to the time you get the full map and directions. Firefox takes about half the time and Google Chrome takes about half that time again. Be patient with the cache raider. As the process runs in javascript on your own computer a slower computer will take more time to process than a top of the line computer. It's also possible that your computer may run too slow to actually do anything. There's nothing Geocaching Australia can do to help you here.

A few quirks that I noticed which are not really quirks, but may cause you to think they are. When it comes to routing, it seems that the route will preference left hand turns over right hand turns and will nearly always try to park you on the correct side of the road. In the urban areas this may mean you look at a route and think "hey I wouldn't go that way". I know I did. But when you examine the caches and route, even though you may bypass one going in a particular direction which may only be a street away, you end up winding your way back to it after finding caches a bit further away. As has been said, the route is not optimal, but it's pretty close and with a +/- 10% variance over the time / distance it's very useful.