---
schema_version: "1"
id: 641b94913316e861b66c82d6b6c4c4f20fad44050d3a09ba87b1b7ca7781d967
title: Join Spatial Files in Tableau
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/public/desktop/maps_spatial_join.md
canonical_url: https://help.tableau.com/current/public/desktop/en-us/maps_spatial_join.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 98cba508c449095f1299bf97b27d448c57202647439158b78d4ed317ea7b6ac5
description: Join spatial files using their geometry or with spatial calculations.
---
[Skip to main content](#main-content)

# Join Spatial Files in Tableau

You can use spatial data to create maps or other chart types in Tableau. If you have two spatial data sources, you can join them using their spatial features (geography or geometry). You can either join two spatial files together or use a spatial calculation to join a spatial file with non-spatial data that includes latitude and longitude fields.

Tableau supports connection to the following spatial data sources:

- Shapefiles
- MapInfo tables
- Keyhole Markup Language (KML) files
- GeoJSON files
- TopoJSON files
- Esri File Geodatabases

If you have WKT (well known text) in a CSV or Excel file, you can import the data and then translate it to spatial data on the Data Source page. You can also use MAKEPOINT to convert data that has latitude and longitude coordinates into spatial data. See [Create a spatial data source using MAKEPOINT](https://help.tableau.com/current/public/desktop/en-us/functions_functions_spatial.htm#Create).

For more information on the types of spatial files you can connect to in Tableau, and how to connect to them, see the [Spatial File](https://help.tableau.com/current/public/desktop/en-us/examples_spatial_files.htm) connector example.

**Important note:** In Tableau 2021.3 or later, you can create spatial joins between point/polygon, polygon/line, polygon/polygon, and line/polygon features. In Tableau 2021.2 and earlier versions, you can only create spatial joins between points and polygons.

## Join spatial files

> [!TIP]
> 
> Tip: To create, edit, or view spatial joins, you must first open a logical table in the relationship canvas—the area you see when you first open or create a data source—and access the join canvas.

1. Open Tableau and connect to the first spatial data source.
2. Open the join canvas for your data source by double-clicking the table on the canvas to open the join canvas (physical layer).
3. On the upper-left side of the Data Source page, under Connections, click Add.
4. In the Add a Connection menu that appears, connect to your second data source. Drag the second data source onto the join canvas.  
    ![A diagram of a spatial join between spatial data sets.](/tableau/current/en-us/public/desktop/en-us/Img/spatial_join1.png)

1. Click the Join icon.
2. In the Join dialog box that appears, do the following:

- Select a join type.
    
    For more information about each of these types, see [Join Your Data](https://help.tableau.com/current/public/desktop/en-us/joining_tables.htm#jointypes).
- Under Data Source, select a spatial field to join by.
    
    Note: Geometry is the default field name for spatial file sources except in SQL Server, where users create field names. Spatial fields have a globe icon ![Globe icon indicating that Geographic role applied to field.](/tableau/current/en-us/public/desktop/en-us/Img/globe.png) next to them.
- For the second data source, select another spatial field. If your second data source isn't a spatial file and contains latitude and longitude fields, select Create Join Calculation as the join clause so that your data can be used in a spatial join. For more information, see [Spatial Functions](https://help.tableau.com/current/public/desktop/en-us/functions_functions_spatial.htm).
- Click the \= sign and then select Intersects from the drop-down menu. You can only intersect two spatial fields.
    
    ![Tableau join dialog with options for inner, left, right, and full outer joins.](/tableau/current/en-us/public/desktop/en-us/Img/spatial_join2.png)

4. When finished, close the Join dialog box.
    
    The map updates to show the count of waterfowl sightings in each basin, and you’re ready to start analyzing your spatial data.
    
    ![A map of Japan, with varying shades of green indicating slope mean.](/tableau/current/en-us/public/desktop/en-us/Img/maps_spatial_analysis.png)
    
    For more information on building different chart types, see [Build Charts and Analyze Data](https://help.tableau.com/current/public/desktop/en-us/design_and_analyze.htm).

## Troubleshoot spatial joins

### SQL Server error: Geometry is incompatible with geography

Although SQL Server supports both a geography and a geometry data type, Tableau only supports geography data type from SQL Server from the following geographies: EPSG:WGS84 = 4326, EPSG:NAD83 = 4269, EPSG:ETRS89=4258. If you try to add a different geography, or a geometry field from SQL Server to your analysis, you’ll receive an error.

### Vertex ordering

Different spatial systems may order their vertices differently. If two spatial files contain two different vertex orders, it may cause problems with your analysis. Tableau interprets ordering specification according to the order of the spatial data source.

For more information, see [Spatial Join Slow and Returns Inverted Results Using KML or SQL Spatial Data Imported from Shapefile or GeoJSON](https://kb.tableau.com/articles/issue/spatial-join-slow-and-returns-inverted-results-using-kml-or-sql-spatial-data-imported-from-shapefile-or-geojson?lang=en-gb) and [Supporting advanced spatial analytics with changes to lines and polygon edges in Tableau](https://www.tableau.com/about/blog/2018/8/supporting-advanced-spatial-analytics-changes-lines-and-polygon-edges-tableau?_ga=2.102831876.545437502.1654528953-1215196164.1596129853) in the Tableau Knowledge Base.

## See Also:

[Spatial File](https://help.tableau.com/current/public/desktop/en-us/examples_spatial_files.htm)

[Join Your Data](https://help.tableau.com/current/public/desktop/en-us/joining_tables.htm)

[Create Tableau Maps from Spatial Files](https://help.tableau.com/current/public/desktop/en-us/maps_shapefiles.htm)

[Create Dual-Axis (Layered) Maps in Tableau](https://help.tableau.com/current/public/desktop/en-us/maps_dualaxis.htm)