+Amberel Posted March 5, 2012 Share Posted March 5, 2012 Hopefully I might have a look at this later today, maybe while I'm watching the Ireland/France match. Work got in the way yesterday afternoon, and again today, and I'm out caching tomorrow. I have come up with a simple algorithm, if I get 10 minutes I'll code it up and leave it running tomorrow while I'm out - it's likely to take longer than the original question. Does this do what you wanted? 1) Create temporary integer columns Group and GroupStatus, initialise all rows to 0. Group will be used to identify all caches in one interconnected group, i.e. where all the caches in the group are less than 2 minimum separation distances from any other in the group. Group Status will be used only during the computation, 0 means unprocessed, 1 means unprocessed high priority, 2 means processed. 2) Pick any cache where GroupStatus=0. If there are none left, it's finished. 3) Increment the Group number. 4) Set the selected cache Group to the current Group number, and GroupStatus to 2. 5) For all caches within 2 minimum separation distances, and for which GroupStatus is still 0, set Group to the current Group number, and GroupStatus to 1. 6) Select any cache where GroupStatus=1. If there are none go to 2. 7) Set GroupStatus to 2. 8) Go to 5. This doesn't get as far as calculating the area. There may be an elegant mathematical solution to that, but I don't know it. I'll probably kludge it by plotting the circles onto a bitmap and counting the pixels. RGds, Andy Quote Link to comment
I! Posted March 5, 2012 Share Posted March 5, 2012 Comments inline ... 1) Create temporary integer columns Group and GroupStatus, initialise all rows to 0. Group will be used to identify all caches in one interconnected group, i.e. where all the caches in the group are less than 2 minimum separation distances from any at least one other in the group. Group Status will be used only during the computation, 0 means unprocessed, 1 means unprocessed high priority, 2 means processed.2) Pick any cache where GroupStatus=0. If there are none left, it's finished. 3) Increment the Group number. 4) Set the selected cache Group to the current Group number, and GroupStatus to 2. 5) For all caches within 2 minimum separation distances of the cache whose GroupStatus you've just set to 2, and for which GroupStatus is still 0, set Group to the current Group number, and GroupStatus to 1. 6) Select any cache where GroupStatus=1. If there are none go to 2. 7) Set GroupStatus to 2. 8) Go to 5. I've got essentially the same (except it's implemented recursively) in R, together with what is getting pretty close to being an exact calculation of the area. The code assumes a flat Earth; I couldn't face coding the distance calculations properly. I don't have the full set of UK waypoints, though, so I'm probably not going to run the code for real - and, anyway, R is slooow. Quote Link to comment
I! Posted March 5, 2012 Share Posted March 5, 2012 Of course the answer to the question what's the island-of-exclusion ("Group") with the greatest number of caches? would also be interesting - and you've got that with your algorithm as it stands. Quote Link to comment
+Amberel Posted March 5, 2012 Share Posted March 5, 2012 Comments inline ...Your comments are as I intended it to read.I've got essentially the same (except it's implemented recursively)Mine isn't coded like that - I intended it to be a simpler description for non-programmers.The code assumes a flat Earth; I couldn't face coding the distance calculations properly.As the separation in distance calculations is not more than (just under) 322 metres, not using a great circle distance should introduce an almost immeasurably small error. If you mean you use a 2D projection it may introduce a percent or two. I'm nearly ready for tomorrow, so I'll knock up the first part this evening and run it overnight. As I'm up and about much earlier than my caching buddy I'll probably have an answer to "what's the island-of-exclusion ("Group") with the greatest number of caches?" before I go out. Rgds, Andy Quote Link to comment
+Amberel Posted March 6, 2012 Share Posted March 6, 2012 (edited) I'm nearly ready for tomorrow, so I'll knock up the first part this evening and run it overnight. As I'm up and about much earlier than my caching buddy I'll probably have an answer to "what's the island-of-exclusion ("Group") with the greatest number of caches?" before I go out. Number of caches in group, OS grid ref SW, OS grid ref NE (the bounding rectangle is for the caches, not the exclusion zone, but it's enough to tell you where to look). 162 570111,205428 584679,209517 159 366593,303795 370544,312264 94 263230,145177 268091,148288 89 530978,180028 534347,182282 82 578902,109135 582974,111237 82 492855,202254 497863,205395 74 373109,302595 376247,306837 74 361603,312202 365305,315586 73 523633,153391 527712,156869 70 516140,148643 520050,151763 The first one has Chelmsford on its west side, and largely comprises the west end of the Chelmer powertrail plus a load of caches in Chelmsford itself. Had there not been a break in the powertrail at Hoe Mill Barns, it would have been considerably larger. The second is at Telford. These are numbers of caches, not area. I suspect the Telford group will have the larger area because the caches along the Chelmer are mostly are at the minimum separation distance whereas the Telford ones mostly are further apart. The gap between 2 and 3 is such that I suspect the others won't come into play. I'll do the areas some other time, but it won't be today. Rgds, Andy Edited March 6, 2012 by Amberel Quote Link to comment
I! Posted March 6, 2012 Share Posted March 6, 2012 162 - wow - much more than I expected. Could you mail me the coords for everything in the top ten above in some easily-readable format? PM to follow. Quote Link to comment
I! Posted March 11, 2012 Share Posted March 11, 2012 I've been pestering Andy for various datasets so that I can do the area calculation. You'll be thrilled, I'm sure, to learn that we're ready to share the results. Andy's search parameters: Groundspeak only, 10 Mar 2012 Include traditional, multi, letterbox, unknown, Wherigo Exclude virtual, earthcache, webcam, events, all remaining cache types Include temp disabled, exclude archived Results: Nr | Area | Area/Nr | Density | SW grid ref | NE grid ref ----+---------+---------+---------+---------------+-------------- 162 | 110.330 | 0.68105 | 0.89775 | 570111,205428 | 584679,209517 159 | 108.051 | 0.67956 | 0.89978 | 366593,303795 | 370544,312264 94 | 68.924 | 0.73323 | 0.83624 | 263230,145177 | 268091,148288 84 | 66.114 | 0.78707 | 0.77966 | 492855,202254 | 497958,205395 82 | 57.256 | 0.69824 | 0.87902 | 578902,109135 | 582974,111237 74 | 54.647 | 0.73847 | 0.83183 | 361603,312202 | 365305,315586 74 | 49.756 | 0.67237 | 0.91360 | 530978,180028 | 534347,182282 74 | 55.104 | 0.74465 | 0.82493 | 373109,302595 | 376247,306837 72 | 52.175 | 0.72466 | 0.84789 | 523633,153511 | 527712,156869 66 | 47.879 | 0.72545 | 0.84765 | 548411,163060 | 551865,165981 Key: Nr = number of caches in the group Area = number of 0.1-mile disks (equivalent) area covered by the caches Area/Nr = as it says Density = how much more tightly packed the group is compared to a maximally compressed linear powertrail of the same length (<1 = less packed) So now you know. 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.