Getting Started with GEOGRAPHY Data—Why Don’t Planes Fly in a Straight Line?

GEOGRAPHY basics (aka, why don’t planes fly in a straight line?)

We’re all familiar with looking at visual representations of the earth. Depending on your age, you may remember flat poster maps decorating your classroom walls. Maybe your history teacher had a globe on their desk. Or maybe once upon a time you kept a book of maps in your car for road trips. Still, most of us today are accustomed to looking at our phones for anything related to where we are in the world, or where we’re going.

Let’s focus on that globe on your teacher’s desk for a moment. As a kid (or even as an adult!), you probably spun that globe, maybe letting your fingers glide across the smooth surface as the spherical object rotated round and round. You probably also found your location on the globe and looked at how you might travel to some other interesting country or continent. Perhaps you traced your finger along the path from your current location to that other place. If you did, chances are you didn’t trace the shortest path possible!

Look at the image above. Imagine if an airline told you that when flying from Berlin to San Francisco, the plane’s path would travel over Iceland, Greenland, and Canada. You’d think they were nuts, right? Clearly that arc is a longer flight than just simply drawing a straight line with your finger from Berlin to San Francisco like this:

That looks so much shorter! Ah, but it’s not. And the reason gets to the heart of understanding the GEOGRAPHY data type in Snowflake: the difference between geodesic and euclidean measurement. Simply put, geodesic measurement is based on a 3D spherical shape and measures distance over a curvature, whereas euclidean measurement is based on the flat 2D shape most of us are used to seeing in the above image. When we look at the line in the first image from more of a spherical perspective, though, we see why a plane would want to fly on that flight path: