What is a Spatial File in Tableau?
Working with maps in Tableau is often where a C- an a-ha moment. Suddenly, your location data isn’t just a list of cities or postal codes, it’s a living part of your dashboard. But to move beyond simple dot maps, you'll need to use spatial files. This article will show you what spatial files are, the different types you can use in Tableau, and how to use them to create powerful, custom map visualizations.
What Exactly is a Spatial File?
In simple terms, a spatial file is a data file that contains geographic information. Unlike a simple spreadsheet with columns for "City" and "State," a spatial file holds the raw geometric data that defines specific shapes and locations on Earth. It allows you to map things that Tableau’s standard geocoding can’t quite figure out on its own, like custom sales territories, specific delivery routes, or the precise footprint of a national park.
This geographic information generally comes in three main forms:
- Points: These represent single, specific locations. Think of them as individual pushpins on a map. A point could be the location of a store, an ATM, a specific customer's address, or the epicenter of an earthquake.
- Lines (or Polylines): These are a series of connected points that form paths or routes. They are perfect for visualizing things like rivers, highways, flight paths, or a specific walking trail through a city.
- Polygons: These are areas or regions enclosed by a boundary. Polygons are used to define things that have a specific shape and area, such as country borders, state boundaries, zip code areas, sales regions, or park boundaries.
Why Use Spatial Files Instead of Standard Geocoding?
Tableau does a fantastic job of automatically converting place names, like "New York" or "90210," into latitude and longitude coordinates. This process is called geocoding. So why go through the trouble of finding a separate spatial file?
1. Creating Custom Territories and Boundaries
Your business likely doesn't operate neatly along official state or county lines. You probably have custom sales regions like "Northeast," "West Coast," or specific territories assigned to reps. Standard geocoding can’t draw these for you. With a polygon spatial file, you can load your custom regions directly into Tableau and color-code them based on performance metrics like revenue, leads, or customer concentration.
2. Visualizing Specific Paths and Networks
If you need to show the exact route of a delivery truck, a proposed public transit line, or the flow of a river system, you need line data. A spatial file lets you plot these precise paths, which is impossible with standard geocoding that can only plot the start and end points of a journey.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
3. Mapping Highly Precise, Non-Standard Locations
Sometimes, an address isn't enough. You might need to map specific non-addressable assets like oil wells, cell towers, or monitoring stations out in a field. Spatial files store these exact latitude and longitude points, giving you pinpoint accuracy that an address-based geocoding system might struggle with.
4. Working with Private or Offline Data
Tableau's geocoding sends your geographic data to an external server to get the coordinates. Using a spatial file means all the location data is self-contained. This is ideal when working with sensitive information or when you're offline without an internet connection.
Don't forget! The Geometry field is the key
When you connect to a spatial file in Tableau, you’ll notice a special field in your data source called Geometry. This is the magic ingredient! This field contains all the points, lines, or polygons from your file. To create a map, you simply drag the Geometry field onto the main canvas, and Tableau takes care of the rest, drawing your custom shapes. We'll be walking you through this process in section #.
Common Types of Spatial Files Supported by Tableau
Spatial data comes in many different formats. While it might seem confusing, you’ll typically only run into a few common types when working with Tableau.
Shapefiles (.shp)
Chances are, this will be the first spatial file type you encounter. Despite its singular name, a Shapefile is actually a collection of several files that must be kept together in the same folder. When you connect, you’ll select the .shp file, but Tableau will need its companions - like the .dbf (database file with attributes) and .shx (index file) - to work correctly. Shapefiles are an industry-standard format created by Esri and are widely available from "open data public resources like municipal or national data portals.
KML (.kml)
KML stands for Keyhole Markup Language. If you've ever used Google Earth or Google Maps to create custom maps, you've worked with KML. These files are great because they often contain rich formatting like custom place markers, pop-up descriptions with HTML, and specific camera angles. KML is a fantastic choice for lighter-weight files and for data originating from web-based map applications.
GeoJSON (.geojson) and TopoJSON (.topojson)
These two are the preferred formats for modern web applications. GeoJSON is based on the lightweight JavaScript Object Notation (JSON) format, making it easy for both humans and computers to read. It's a single file that’s incredibly versatile. TopoJSON is an extension of GeoJSON that's optimized for file size, it avoids redundancy by storing topology, which means shared lines between two polygons are only stored once.
Esri File Geodatabases (.gdb)
If your organization uses Esri ArcGIS, a popular Geographic Information System (GIS), your data may be stored in a File Geodatabase. This is essentially a folder with the .gdb extension that can contain multiple spatial datasets. Tableau can connect directly to them, making it easy for business analysts to tap into the powerful spatial data created by their GIS departments.
Step-by-Step: How to Use a Spatial File in Tableau
Okay, let's put this into practice. Let’s imagine we want to map sales territories and blend them with our existing sales data to see which regions are performing best.
Step 1: Get Your Spatial File
First, you need a spatial file. You can often find these from public sources like U.S. Census Bureau for zip codes, or local government sites for neighborhood boundaries. For our example, we'll assume we have a Shapefile named SalesTerritories.shp that defines our custom business regions.
Step 2: Connect to the Spatial File
Open Tableau Desktop and in the Connect pane on the left, click on Spatial file. Navigate to the folder where you saved your SalesTerritories.shp (and its accompanying files) and open it. That's it! Tableau will load the data, and you'll see a Geometry field in your tables list.
Step 3: Build a Basic Map
Go to your worksheet. To get your territories onto a map, simply double-click the Geometry field. Tableau intelligently knows this is geographic data and will automatically generate a map with your custom polygons.
You can already see your regions, but you can dress it up by dragging the field representing the territory name (e.g., "Region Name") onto the "Label" card to display the names on the map.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Step 4: Combine Spatial Data with Your Sales Data
A map of empty territories isn't very useful. The real power comes from joining it with your performance data. Let's assume you have a separate file - an Excel sheet called SalesData.xlsx - with columns for Sales Amount, Customer Name, and Latitude/Longitude for each sale.
- Go to the Data Source tab. You should see your SalesTerritories data source.
- Click Add to connect to a new data source and select your SalesData.xlsx file. Now you have two connections.
- Drag the SalesData sheet onto the canvas.
- Drag the geometry from your SalesTerritories sheet out next to it to create a relationship.
- This opens the "Edit Relationship" dialog, which is where the magic happens. Here, you'll perform a spatial join. Tableau often detects it automatically, but if not:
Now that your data is joined, you can visualize it.
- Go back to your worksheet. You still have your map built on the Geometry field.
- From your SalesData fields, find a measure like "Sales" and a measure such as "# of new sales" to drag onto the Color card.
Instantly, your map will transform. Each custom territory is now color-coded based on its total new customers or revenue. With just a few clicks, you have turned abstract sales numbers into an intuitive geographic insight!
Creating Advanced Maps: Dual-Layer Maps
You may also decide that another layer over your map may bring some rich additional detail within your dashboard. Not only do the different regions have their specific visualization, but you can also break them down by the number of orders using color gradients and display the size of each sales number clearly on top.
This is called dual-axis mapping. It involves creating a duplicate Latitude (generated) in your rows by holding down CTRL on your map and clicking + dragging another copy beside it, then making the following changes:
- Remove your original AGG(Num_of_orders) and drag your chosen secondary KPI from your Measures section in your Marks.
- Change your polygon map into individual bubbles over the region.
Final Thoughts
Working with spatial files opens up a massive range of possibilities in Tableau. By going beyond basic location names, you can analyze your business using the precise geographic boundaries that matter to you, discovering insights that were previously hidden in spreadsheets. From custom sales regions to detailed transit networks, spatial files empower you to create maps that truly tell the story of your data.
Ultimately, data visualization is all about getting to insights quickly. Joining spatial files with transaction data in BI tools is powerful, but often the set-up can feel complex, with multiple data sources to manage before you ever get to the analysis. At Graphed, we’re obsessed with making this process radically simpler. By connecting your marketing and sales data sources just once, you can ask questions in plain English - like “show me my Q3 revenue by sales region” or "compare sales from Facebook Ads vs Google Ads in our east coast territory" - and get analysis and visualizations back in real-time, so you can focus on making decisions, not on manipulating data files.
Related Articles
Facebook Ads for Moving Companies: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for moving companies in 2026. This comprehensive guide covers budget allocation, creative strategies, targeting, and optimization to generate more moving leads.
Facebook Ads for Auto Repair Shops: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for auto repair shops in 2026. Discover targeting strategies, budget recommendations, ad creative tips, and proven tactics to fill your appointment book consistently.
Facebook Ads for Realtors: The Complete 2026 Strategy Guide
Discover how to use Facebook Ads for realtors to generate more leads in 2026. Learn proven strategies, targeting methods, and budget recommendations for your real estate business.