@clonetek My MIL lives there, I’ll tell her to tell you hi. I’ve wondered who lights it up. I originally questioned if IP geolocation lit the map as I’ve purchased when over there before and seen it lit up.
If we really want to dive deep here I can shed some light on how this works. I haven’t looked at the code in a while and it hasn’t been touched since @katylava last worked on it June 29th, 2016. Maybe we’ll spot a bug or maybe we’ll agree it’s working as expected…
We use the shipping address of the order to determine placement on the map. To work with geographic data at the county-level we’ve found it best to translate the ZIP code to the FIPS county code. To achieve that, we use the USPS ZIP code crosswalk data maintained by the U.S. Department of Housing and Urban Development (yes, the one under Secretary Ben Carson).
/image ben carson
My guess (without any investigation so far) is that your ZIP code is either incorrectly or ambiguously mapped to the wrong FIPS country code in this dataset.
Also, to provide a proper heatmap we have a population density breakdown at the FIPS-level.
Here’s the ZIP to FIPS data:
Here’s the population data:
Here’s a snippet of code that puts it all together:
Maybe if @djslack is up for sharing his ZIP code with us we can collectively research if we have a data bug, or a logic bug, or something else.
@shawn Wow. Thanks for all the insight here. It’s 71037.
I started to check the FIPS code myself but didn’t see an easy way to do that on my phone.
From a look at the zip code map boundaries, it looks like it may just be mapped to the wrong FIPS code. It looks like it has a hard edge at the parish line at first glance so it shouldn’t be ambiguous.
In the rural area where I grew up, and where my mom still lives, our zip code covered portions of three different counties. If I ever ordered something and had it shipped to her I’d be curious to see if the correct county lit up, or if it would light up the county that the “town” is in.
@PurplePawprints My town is in 3 counties and only has 1 zip code. It can make for some confusion at election time for those not in the primary county as they have to travel to other towns for the polling location that corresponds to their township.
One of the county lines runs through a house on the next block; it also runs through the elementary. I received a jury summons for that 2nd county once.
The 3rd county is about a block-and-a-half from my house.
Due to consolidation, the school district is in parts of 5 or so counties.
@djslack I believe it did even before the change, but I don’t always check when I order stuff so I could be mistaken. At one point IIRC the map required 2 or 3 purchases in a county (or parish as in your case) for the county to light up.
If FIPS assigns county numbers by alphabetical order with larger numbers equating later in the alphabet, then my purchases would have registered in the correct county anyway. They still will as the largest portion of the town is in the county I live in.
When we encounter a scenario like this we pick one of the FIPS codes to map to. We were picking the last matching entry that appeared in the file.
What I hadn’t noticed before is this TOT_RATIO data. This is saying that 99.98% of the addresses for ZIP code 71037 are in FIPS code 22015 and the remaining 0.02% of the addresses are in FIP code 22119.
I’ve made a change so that if we encounter a scenario like this we pick the ZIP to FIPS mapping with the largest TOT_RATIO. In this case, it gives us a 99.98% chance that we highlight the correct county on the map (which is far better than @hollycrisson thinking we just made some shit up ).
@shawn Thanks! You are the man! I totally didn’t expect my asking a dumb question to get your attention and actually have you spend time on a fix today. Or to learn so much about how the map works behind the scenes.