My Authors
Read all threads
Since we're all at home panic-refreshing Twitter, let's use this time to learn a new geospatial concept! Today's lesson: converting points to polygons. (If you've ever wondered why cartographers hate on zipcode data, read on!)
Here’s our data! Let’s say it’s addresses where cute dogs live. You want to create a boundary (a polygon) that includes all the cute dogs. Image
Here’s one way to do it: literally draw an area that includes all the points. Image
Sweet we did it! But what does this polygon tell us about the underlying point data? Not much. That polygon can be massive and still contain all those points.
Imagine another use case: every point is a nest from a particular type of bird. Our goal is to figure out that bird’s endemic region based on this data. In that case, we probably want our polygon to fit the point data more closely.
There are two tools/concepts to cover here: concave hull and convex hull. Here’s what they both look like: concave hull in green, convex hull in orange. Image
“Concave hull” is the smallest area that contains all the points. Think of this like shrinkwrap, wrapping all of these points. While a concave hull contains the smallest area, it also creates the longest boundary.
“Convex hull” is the simplest polygon that contains all of the points. Think of this like a rubber band wrapping around all the points.
What does this have to do with zip codes? Boy am I glad you asked!
Welcome to Anytown, USA. The purple lines are roads and the black points are addresses. We are the US Postal Service. Image
Anytown has two zip codes, A and B. Image
So if my job is to deliver to all homes in zip code A, what is my delivery area? It depends. Let’s try it with a convex hull: Image
And a concave hull: Image
Okay cool this makes sense, every address is contained. But what if someone builds a new house? Here’s their new (pink!) driveway and their new house. Image
With a convex hull around zip code B, the new house clearly falls into that zip code. But I gave it zip code A. Why? Image
Because as a mail delivery person, I need to stay on the road, on my route. My buddy in zip code B isn’t going to roll all the way down to my area, up and around to get to the new house because it happens to be in their zip code area. No, it’s on my route, it gets zip code A.
So a true zip code area is a set of points (addresses), connected to each other by a set of lines (roads), and many areas that don’t have addresses and aren’t included at all (blue circles). Image
THIS IS WHY ZIP CODE POLYGONS ARE UNRELIABLE! There are many methods to use when creating a polygon out of points, and it fully depends on the use case. And guess what y’all, the USPS use case doesn’t really apply to most other uses.
If you want to take the US & break it up into chunks to visualize or do analysis, may I suggest:

- census tracts, which each have roughly the same amount of people (2,500-8,000)
- hexagons, which contain the same geographic area
- political boundaries, if your use case warrants
Thank you for tuning into this Twitter-torial! I’ll be here forever probably doing this again tomorrow because it was a nice little break from freaking out about the end of the world. ✌️💕🗺
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Lyzi Diamond

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!