How is Lyft able to tell you how far away your driver is? How does DoorDash give accurate estimates for the food you just ordered? Both of these satisfying user experiences are possible because of spatial data. In this blog we’ll cover the basics of spatial data and then show some examples of common applications and use cases that use spatial data.
Spatial Data, often referred to as geospatial data, is any data that contains information about a specific location. In layman’s terms, spatial data is data about location. You may not realize it, but you’re already familiar with spatial data because you interact with it whenever you open your map application to look for the nearest gas station or to see the full landscape of cafes nearby.
The quantity of data that relates to location is overwhelming, but becomes easier to digest when broken down into the two most commonly used spatial data types.
The two primary spatial data types are Geometric and Geographic data.
Think about the last time you were running low on gas in an unfamiliar area. You probably used a map application to pull up all the gas stations nearby. That application contains geometric data that captures all the data related to the roads nearby. That application can tell you how long it will take you to get to the gas station by applying driving speed pattern data, with traffic pattern data, and the geometric data.
The map application is the simplest of spatial data examples. There are literally thousands of other examples.
The Internet of Things (IoT) refers to networks of objects that are embedded with sensors (think Bird scooter or Citi Bike) that make it possible to send data from the “thing” to a database. IoT workloads often employ spatial data. Here are a few examples:
Transportation and logistics companies deal with the movement of people and products. These include companies such as airlines, trucking, railroads, shipping, and logistics firms, as well as companies that provide transportation infrastructure. Here are a few examples of spatial data workloads from that industry:
Environmental technology is the use of electronic devices to monitor a natural environment. The output of environmental technology could be measurements of tidal patterns, temperature patterns, or the status of a forest fire. The most relatable spatial data workloads have to do with using environmental technology to protect the environment and ourselves.
These are just a few examples of how spatial data is used in the real-world. There are tons of other use cases for spatial data that relate to urban planning, or fraud detection, geomarketing, civil engineering, and more.
When you talk spatial data you have to talk PostGIS. PostGIS is the spatial database extension for PostgreSQL. It has over 300 different built-ins and functions to make it easier to work with spatial data. PostGIS has helped launch apps like Instagram and FourSquare and is included in the tech stack for countless other applications.
Until very recently Spatial Data workloads could not reliably be built on any of the truly distributed databases. But that isn’t the case anymore. CockroachDB, the cloud-native distributed SQL database, now supports spatial data types. Rather than reinvent the wheel, CockroachDB uses the same PostGIS compatible SQL syntax. So you can build applications that leverage spatial data on a database that’s always on, easy to scale, and simple to use.
Deploying spatial data workloads on a distributed database, rather than a monolithic database means that reads and writes aren’t routed through a single node and you don’t have to do asynchronous replication across multiple sites. And when it’s time to scale to different regions you don’t have to worry about manual scaling responsibilities.
If you have questions about spatial data you can ask them in the CockroachDB community slack. If you want to learn more about deploying distributed spatial data workloads you can look at our spatial features support documentation.
In last week's episode of The Cockroach Hour, Jim Walker chatted with Red Hat principal product manager Scott …Read More
Simulating a CockroachDB cluster can be an incredibly useful tool for testing, training, and development work. …Read More