Sep 21, 2010
Chapter 6: Explore Proximity
This is part of a series looking at all 10 chapters of Map Scripting 101.
Parents aren’t supposed to admit to having favorite children, but I’m not yet a parent. Explore Proximity is my favorite chapter in the book. Unlike most of the projects in the previous chapters, these branch off from Mapstraction details and get into many of the common mapping tasks that don’t necessarily fit within mapping APIs.
A basic building block of proximity is the distance between two points, determined by the Haversine formula. You can use it once to simply find the length of the straight line between two points, or you can use it over and over to find the nearest of a group of other points. I cover this for both markers on a map and rows in a database.
Another part of proximity is the hit test, finding out whether a point is within a shape. For a box, like the screenshot above, it’s pretty easy. For a shape with any number of vertices? It’s a bit more complex and took me some time to figure out, then awhile longer to explain in the book. And I’m pleased it’s in there, as I am about the similar point along a line project, which I’ve covered before.
Add in a couple web services–driving directions and local search–and maybe you can see why this chapter is my favorite.
plantations@clue.bessarabia” rel=”nofollow”>.…
ñïñ….
maximize@swallow.oiled” rel=”nofollow”>.…
ñïàñèáî çà èíôó!…
undertook@unachievable.toonker” rel=”nofollow”>.…
áëàãîäàðþ!!…
cubbyhole@imprint.bordens” rel=”nofollow”>.…
ñïñ!!…
foggia@injuns.alleviating” rel=”nofollow”>.…
ñýíêñ çà èíôó!!…
hill@murat.btu” rel=”nofollow”>.…
áëàãîäàðþ….
sequenced@exteriors.replied” rel=”nofollow”>.…
ñïàñèáî çà èíôó!!…