Friday, July 15, 2011

Mystery Letterboxes

Please review the emergency instructions
on the brochures in the seat-back pocket
in front of you. You may experience
turbulence, but we'll get you through it!
Believe it or not, I still have more information I'd like to share about the Big Update earlier this week. Today's discussion will focus on mystery letterboxes. I've already talked a little about them in the context of counties, but there is a lot more to them than merely being able to specify a county. =)

If you've run some searches on Atlas Quest, you might have noticed that for the first time, mystery boxes will be included in a location-based search, and that's why you'll always see the "Mystery Boxes" attribute available on the Advanced Search page. Any search you do could possibly return mystery boxes including trip planner searches and location-based searches. So let's run a search for all mystery boxes within 150 miles of Providence, RI.

You might be wondering.... how can AQ possibly calculate the distance to a mystery box--it's a mystery, after all! Rhode Island, as you all might be aware, is a pretty small state. All mystery boxes located "somewhere within Rhode Island" are going to be within 150 miles of Providence because there are no locations still in Rhode Island that are further away than 150 miles. AQ might not know the precise distance of the letterbox, but it knows that all Rhode Island mystery boxes are within 150 miles of Providence. It's impossible for it not to be. =)

Previously, we knew this intuitively, but AQ didn't have the ability to figure this sort of thing out on it's own. This update changes that. Now, every single location AQ knows about has a latitude and longitude coordinate and it has a radius. Rhode Island is listed with a radius of 40.39 miles centered around 41.582584, -71.503414. Obviously, Rhode Island isn't a circle, but these numbers are good enough for an approximation, and when we're talking about mystery boxes, approximations are usually plenty fine. Being approximately correct is better than being precisely wrong. =)

Now, when you run a search for all boxes within 150 miles of Providence, Rhode Island, AQ calculates the distance in two steps. First, it calculates the exact distance--as the crow flies--from the center point of Providence (41.823856, -71.411741) to the center point of the letterbox (41.582584, -71.503414 for Rhode Island mysteries), which comes out to 17.31 miles. So the "average" Rhode Island mystery box is expected to be about 17.31 miles from the city center of Providence. But the thing is, the actual box location could be a lot further away than that. In a worst case scenario, the mystery box might be out the very outer edge if the mystery area, on the other side of the center point for the state: In other words: 17.31 miles + 40.39 miles = 57.7 miles away.

That is--roughly speaking--the worst case scenario for a Rhode Island mystery box if you're in downtown Providence, and that's the distance AQ uses for sorting boxes based on distance. You'd have to run a location-based search that extends at least 58 miles to include Rhode Island mystery boxes, but it will show up.

If you take a look at the results of our search, the first Rhode Island mystery boxes that show up in slot #7 (for me, at least--depending on restrictions, plants, custom locations, etc., your list could be a bit different than mine). Two other types of mystery boxes slip in as being slightly closer to Providence than those that are "somewhere in Rhode Island": county mystery boxes.

A couple of RI boxes are listed as being "somewhere in Providence County" and a few more are listed as being "somewhere in Windham County." Providence is in Providence County, so we know a mystery box in Providence County will be closer than mystery boxes in any other county of Rhode Island, and with an average radius of 16.65 miles, AQ figures that mystery a box "somewhere in Providence County" has a worst-case scenario of 24.9 miles from the center center of Providence.

And similarly, AQ calculation a worst-case scenario of 49.7 miles for mystery boxes in "Windham County." Windham County isn't even in Rhode Island--it's in neighboring Connecticut! But it's nestled right up along the Rhode Island border and the worst-case scenario for having to drive to find a Windham County letterbox is actually about 10 miles less than a worst-case scenario for having to drive to find a "somewhere in Rhode Island" letterbox.

So that's why you'll see Windham County mystery boxes show up before Rhode Island mystery boxes in the search results. In a worst-case scenario, they're probably closer--even if they are in a different state.

When it comes to figuring out the direction a mystery box is located, AQ can't be certain about the Providence County mysteries or the Rhode Island mysteries--we're inside of those locations and the mystery box could be in any direction from the city of Providence. However, the mystery boxes in Windham County, Connecticut--even without knowing precisely where it's located, AQ can tell that's it's "somewhere to the west" of Providence, and faithfully points in the correct direction of the mystery.

It's really pretty neat, and I hope it means more people will start looking for mystery boxes in their neck of the woods as a result. You don't have to do an area search to find mystery boxes--they're all around you, and that now shows up in the location-based searches. The more specific the mystery area is, the more likely you'll see it showing up in a location-based search.

For mystery boxes "somewhere in the United States" (for instance), you're better off just running an area search. AQ has a radius of 3,880.96 miles for the radius of the United States, so a location-based search would have to cast at least a distance of 3881 miles to include those, and tens of thousands of boxes would show up before it. Viewing mystery boxes in location-based searches generally works best if the mystery is a relatively small area such as states in New England or counties.

It's also possible to see mystery boxes show up in trip planner searches, but since a trip planner search is limited to a maximum of 30 miles off of the route being searched, you might not see them show up very often. Take this example of a search for all mystery boxes within 30 miles of I-95 between Key West and Portland, ME. Those county-wide mysteries in Providence County make the cut, along with a couple of mystery boxes in Norfolk County, MA, but that's it. (For the moment!) There might be other mystery boxes along the route, but AQ can't be certain that those other mysteries are within 30 miles of I-95.

If you've been adding custom locations and had to add a location that the geocoders couldn't find, you'll see a space for the "radius" of the location. This is the sort of thing it's used for, and it's very important the the number is approximately correct if you want the box to show up as expected in location-based searches and trip planner searches. You don't need to be exact--and since counties are never perfect circles (so far as I know)--it's impossible to be exact.

In fact, how AQ handles these calculations, it treats mystery boxes exactly like it does for non-mystery boxes. Every location AQ knows about has an associated radius, and it's added to calculated distance to create the distances you see listed in the search results. If you hide a letterbox in a large city park--take New York City's Central Park, for instance--the park has an average radius of 1.68 miles. If you run a search for boxes using Central Park as your search point, all Central Park boxes will show up as being 1.68 miles away. (Radius + calculated distance = final distance, i.e. 1.68 + 0 = 1.68) If you're standing in the center of Central Park, AQ believes those boxes might be up to 1.68 miles away from where you're standing. A box at a rest area with a radius of 0.1 miles--yep--AQ will add 0.1 miles to the calculated distance for that box in the searches.

The point is--whenever you see AQ list the distance, that's essentially a worst-case scenario for how far you'll have to travel to get the box.

On the trip planner, I'll also note, the radius of the location is actually added to the "offpath" distance--not the "mile marker" distance. The offpath column displays the worst-case scenario for how far off path you might have to travel to get the box. There's not really any "worst case mile markers." The box might be located somewhere between "MM10 and MM20" (if the radius of the location is 5 miles), but it's not really practical to list the same box for every MM that it might apply to. So in that case, the MM is based on the center point of the mystery location and the radius is applied to the offpath distance.

Clear as mud? =)

Back to those mystery boxes near Providence. From there, click through to the Map Results link. You'll notice the map is filled with red and green markers. The green ones are new and were added to accommodate all those mystery boxes out there.

The blue icons aren't on this map because we only searched for mystery boxes and the blue icons are used to denote "exact" locations. The red icons represented those boxes where people specified a city for the box but failed to provide an exact address. These boxes typically weren't mysteries, but the accuracy of their locations was always in doubt. And with the additional of genuine mysteries, the coordinates could be a long way off from the actual box location. A mystery box "somewhere in the United States" covers a lot of territory, and I thought it was prudent to be able to identify which boxes might be way off base.

If you've been paying attention so far, you might be wondering, "Yeah, okay, then why are there any red markers at all? All of the boxes in the search are mystery boxes! Shouldn't all of the markers be blue?"

And that's an excellent question. The thing with mystery boxes is that the line that used to identify what counts as a mystery and what does not count as a mystery has grown a little nebulous. Clark County, Georgia, for instance, has a radius of 10.31 miles while the city of Seattle has a radius of 16.59 miles. A box listed as "Clark County, GA" is almost certainly a mystery box, but a box in "Seattle, WA" probably is not--but the confidence level AQ has for the box in Clark County is actually better than it is for the city of Seattle.

It actually gets worse than that in a sense, but it doesn't show up on this particular map. Even a search for just mystery boxes can return a box with an "exact" location. How is that even possible? Because you might have solved the mystery and attached a custom location to the letterbox. Just because you solved the mystery and know where it is doesn't mean the box is no longer considered a mystery box! So if you used a bunch of custom locations, it's entirely possible that AQ will plot an exact location for a mystery letterbox, and use a blue marker as a result.

I haven't solved any of those mystery boxes in Rhode Island, Connecticut, or Massachusetts so AQ doesn't use any blue markers on my map of mystery boxes for the area, but if you have--you'll see them too!

See what a problem adding support for counties caused? Strange paradoxes like these... So now--when you add or edit a letterbox, you can set a "city-wide mystery box" or a "I'm only going to list the city, but this is not a mystery box" option. If you specify a location with a radius that's less than one mile, AQ will not allow it to be a mystery. That's narrowed down so much that for all intents and purposes, it doesn't seem fair to call it a mystery. And if you specify a location that has no name, no address, and no city listed--meaning it's a county-wide (or larger) area, it must be a mystery box and will set the mystery icon. If it's smaller than a county and larger than one mile, however, you'll now have the option to use or not use the mystery box icon on the box.

Don't worry about remembering these details--the only reason I mention all this is to explain part of the reason why AQ's concept of a mystery box is a bit more nebulous than before. Where a non-mystery box ends and a mystery box begins is a fuzzy line.

So when I got to the point where I had to update the map, I considered several options, and finally decided that the color the icon should reflect the relative "confidence level" AQ has about the box being near that specific point. If AQ believes the coordinates are within one mile of the actual box location, it uses a blue  marker. If AQ believes that the coordinates are within 30 miles of the actual box location, a red marker. And if AQ believes that the coordinates might be more than 30 miles away from the actual location of the box, it'll use a green marker. The markers plot the exact latitude and longitude coordinates of the specified location, and the color of the marker identifies how close the actual location of the box might be.

So even though every box in my search returned mystery boxes, some mystery boxes are known to be within a 30 miles radius (the county-wide mysteries if the county has a radius of less than 30 miles) and some mystery boxes are outside of that limit (the state-wide mysteries and county-wide mysteries if the county has a radius larger than 30 miles).

Looking at this map AQ generated, it would appear that most counties in Rhode Island and Connecticut are smaller than 30 miles and most counties in Massachusetts are larger than 30 miles in radius.

I should also point out--I got an e-mail from Kirbert who noticed that a search for mystery boxes in Florida plotted a point far out in the Gulf of Mexico as the "center" of Florida, who strangely saw nothing wrong with this--just that it was an interesting observation. =)

And he's right--this is actually normal and perfectly acceptable. Given the unusual shape of Florida's long panhandle and peninsula, the geocoders have figured out that the best single "point" to mark the center of Florida is actually in the Gulf of Mexico. Take a close look at the image I captured--it contains the entire state of Florida, and that green "A" marker is actually near the center of the image. So if you see mystery boxes mapped in watery locales such as this--just remember, that's not where the box is located--that's just the center point of the mystery area where the box can be found. It would, however, be troubling to see a blue marker at this location since a blue marker means that the box would be within one mile of the marker, and there's no land within one mile of the center point for Florida! A green marker? Nooo problem! =)

Like I said before, this update has a lot of new stuff packed into it, and it'll take awhile for me to try to explain it thoroughly and how all of these moving pieces work. =) That's enough for today, though. More tomorrow! =)

No comments: