Join Spatial Files in Tableau
This article demonstrates how to join spatial files in Tableau using an example.
You can connect to the following spatial data sources: Shapefiles, MapInfo tables, KML (Keyhole Markup Language) files, and GeoJSON files. You can 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. For more information, see Spatial Functions.
Important note: Tableau supports joining two spatial data sources using their spatial features (geography or geometry). You can only create spatial joins between points and polygons.
Open Tableau and connect to the first spatial data source. For more information on the types of spatial files you can connect to in Tableau, as well as how to connect to them, see the Spatial File connector example.
On the upper-left side of the Data Source page, under Connections, click Add.
In the Add a Data Source menu that appears, connect to your second data source.
The two data sources are added to the canvas.
Click the Join icon.
In the Join dialog box that appears, do the following:
Select a join type.
For more information about each of these types, see Overview of join types.
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 next to them.
For the second data source, select another spatial field. If your second data source is not 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.
Click the = sign and then select Intersects from the drop-down menu. You can only intersect two spatial fields.
When finished, close the Join dialog box.
You are now ready to start analyzing your spatial data.
Spatial data can be used to create maps or other chart types in Tableau. For more information on building different chart types, see Build Charts and Analyze Data.
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.
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.