d4b

Where Marketing meets Geometry

Jul 13, 2013 02:00

I have literally six different blog posts rattling around in my head at the moment. Plus, my earlier post from '08 about latitude/longitude grids got me thinking.... I'm in the mood for a bit of juxtaposition of math and marketing, so that's what you're getting this evening. :-)

An important caveat: I am not taking Great Circle (spherical) calculations into account here, nor am I acknowledging that the Earth isn't truly a perfect sphere. These inconvenient matters of reality amount to differences on the order of 1% or less, which is far less than my personal accuracy requirements. I'm also unabashedly favoring a grid tuned for marketing within the continental USA.

My goal here is to find a way to carve a geographic area into marketing regions for future advertising campaigns. While this has obviously been done many times before, and it's probably easiest to simply use zip codes as said regions, such approaches are usually very messy in appearance, and zip codes (and other similar divisions) can vary considerably in terms of physical size, population, and so on. To get far more regular, I guess I could just use a grid of arbitrary rectangles, (well, technically, very-slightly-curved trapezoidal segments of the spheroid, heh), except that my clients are typically going to be looking at distances (from their respective offices) in their own marketing considerations, and I'm finding that other searches in this business are also all expressed in terms of a given radius. Thus, even though it's a bit more computationally complex, it seems more natural to consider circles.


Of course, simply packing a bunch of circles together will yield plenty of uncovered spaces in between all of them. Which brings me to my desired tiling: circles which overlap just enough as to completely cover the map at all points, while minimizing the overlapping space. Compress each overlap down to the chord connecting the two intersecting points of each circle-pair, and we now have well-tiled hexagons, (ideally regular, but they don't necessarily have to be).

Next, let's map this to the Earth's latitude/longitude grid. I'm going to arbitrarily consider a desired radius of five miles for now. Before the overlapping consideration, the east/west ("horizontal") distance between the circles' centers would simply be ten miles, but now we have to calculate them being slightly closer together.
The hexagons' edges are also five miles each, and an apothem (line segment from the center to the midpoint of a side) is (sqrt(3)/2) * 5 = 4.33 mi, so two are 8.66 mi across. "Vertically", (north/south), it's even easier: one full radius down, plus half an edge, which is the same as a radius, and thus, 1.5 * 5 = 7.5 mi.

Since a degree of latitude is very roughly 69 mi, (give or take, due to the whole imperfect spheroid thing), 7.5 mi is a bit (8%) over a tenth of that, and I'm willing to just round the vertical unit dimension of the grid down to an exact tenth of a degree. The length of a degree of longitude is very roughly 69 mi times the cosine of the latitude in that area, more or less.
So, that's 69 * (sqrt(3)/2) = 60 mi at 30°N (Texas to Florida) and 69 * (sqrt(2)/2) = 49 mi at 45°N (Oregon to Maine), to pick two arbitrary latitudes somewhat near the south and north boundaries of the continental US. A fixed horizontal distance of 8.66 mi ranges from 0.144° to 0.177° of longitude between those particular latitudes. So, a grid using 0.14° across would match 8.66 mi at arccos( (8.66/69) / 0.14 ) = 26°N; 0.15° across works for 33°N; 0.16° for 38°N; 0.17° for 42°N; and 0.18° for 46°N.

Farther north of the "tuned" latitude, the fixed (in degrees) grid width will be too short (narrow) to represent the desired shape, or alternatively, an actual five-mile radius will sweep beyond the grid's goal. It's probably better to do this and thus find more data points and then trim to the hexagon, (i.e., greater overlap), than to miss data altogether, (i.e., insufficient reach), and thus, it would seem to make sense to select a grid width tuned for a latitude more southerly than the intended eventual total marketing area. So, 0.14° if that's the entire "Lower 48", or 0.16° if just the Northeast US.

Graphic credits: Friday Puzzles: Cell Phones in Flatland by Tyler, Possible tilings for non-drifting ALFA surveys by Paulo Freire, R. J. Murray Middle School; Sixth Grade Social Studies by Ms. Sowards.

Update: I tried this out using the Google Maps JavaScript API, and it came out pretty much exactly as expected. (Now that I'm getting the hang of using the API, it's also getting easier and faster to create these.) This map of NE PA uses a grid of (0.10°, 0.16°), shown by the blue markers. Five-mile-radius circles are shown in green, and they ever-so-slightly exceed the red hexagons, just as desired. As expected, the hexagons aren't precisely regular, but they are certainly close enough!


math, map, marketing, sak

Previous post Next post
Up