Advance with Assist: Using Custom Backgrounds with Polygon Shapefiles

Data

Advance with Assist: Using Custom Backgrounds with Polygon Shapefiles

by Danny Steinmetz
//

Advance with Assist shares quick solutions to common challenges encountered by the InterWorks Assist on-demand team.

You have a shapefile. You have a custom background. They belong together. Now it’s just a matter of figuring out how to make it work in Tableau …

This is a common challenge we get in both Tableau training and through InterWorks Assist. The best way to illustrate how this holy union is to naturally show an example with famous monuments across the world.

My Example: All Roads Lead to Indy

Below is a picture of the Indianapolis Motor Speedway, showing the different monuments that can fit inside the massive race track. I have the image. I have a shapefile (with help from Drawing Tool for Tableau). I want to be able to use the polygons on the custom image:

Monuments in Indianopolis Motor Speedway

First, add the GEOMETRY field to your view:

Add GEOMETRY

You can see the different dots that seem to outline the monuments above. We just need to tell Tableau a few things:

  1. Which dots belong to which shapes
  2. Which mark type we want (polygon)
  3. The order in which to draw the polygon

 

First, I’ll add my Shape ID, or my structure name, to Color so we can see the difference. We get something like we see below:

Add Shape ID to Color

Next, I’ll change our mark type to Polygon. Be warned! Since we haven’t told Tableau the order of the points, this might look pretty scary:

Change Mark Type to Polygon

Finally, I’ll add Point ID (which contains the order to connect the points), to the Path box in the Marks card:

Add Point ID to Path

Much better! But now I want to add the image to the background. In the toolbar, I hover over Maps, select Background Images from the drop-down menu and select the datasource I’m using:

Map to Background Images

I’ll then select to add the image and input the appropriate information:

Edit Background Image

Notice how the X and Y fields are mapped to the X and Y columns from my data. Tableau will likely default to Longitude and Latitude because we started with the Geometry field.

Next, I click OK, and nothing has happened yet. The reason for this is that Tableau is still using the longitude and latitude coordinates it generated from the shapefile. I need to remove both Latitude and Longitude, then replace them with my original X and Y coordinates:

Replace Coordinates

Now for some final formatting steps. I’ll remove the X and Y axis by right-clicking each axis in deselecting Show Header. Next, I’ll go into my Marks card and click on Color. Near the bottom of the drop-down, there is an axis showing “opacity.” I’ll adjust it down from 100 so we can start to see the background image better:

Take Down Opacity

For this map, I decided to turn my opacity all the way down to zero. Now, the image appears exactly like my original, but it has the added interactivity we all know and love in Tableau. I can add a tooltip, use it as a filter or highlighter and even adjust the color using the Colors card.

Want More Advance with Assist

  1. Advance with Assist: Filtering Select Dates with DATETRUNC
  2. Advance with Assist: Enhancing Dashboards with Custom Icons
  3. Advance with Assist: Tableau Power User Leaving the Company
  4. Advance with Assist: Context Filters and LOD Calculations
  5. Advance with Assist: Custom Subscriptions with Tableau Server Custom Views
  6. Advance with Assist: Blending with Dimension Not Utilized
  7. Advance with Assist: Creating a Sankey Diagram from Survey Data
  8. Advance with Assist: Multiple Dashboard Actions with a Single Click
  9. Advance with Assist: Refreshing Tableau Online Data with Tableau Bridge
  10. Advance with Assist: Parameter Performance Optimization
  11. Advance with Assist: Using Custom Backgrounds with Polygon Shapefiles
  12. Advance with Assist: Changing Default Properties on Data
  13. Advance with Assist: Options for Calculating Percentages
  14. Advance with Assist: Removing Options from Filter List
  15. Advance with Assist: Extracting Year from De-identified Text String
  16. Advance with Assist: Marking the Latest Date on Trend Line
  17. Advance with Assist: What You Need to Know About Aliases
  18. Advance with Assist: Function Compatibility
  19. Advance with Assist: Mass Parameter Replacement
  20. Advance with Assist: Sorting with MONTH in Reverse
  21. Advance with Assist: Ungroup Column Headers That Have Concatenated
  22. Advance with Assist: Connectionless Failure Error in Tableau Server
  23. Advance with Assist: How to Exceed Tableau’s Column or Row Limit
  24. Advance with Assist: Adding Email Links to Your Dashboard
  25. Advance with Assist: Saving User-Selected Filters on Tableau Server
  26. Advance with Assist: Tableau and Named Ranges in Excel
  27. Advance with Assist: Editing Custom Fields in Tableau-Published Data Sources
  28. Advance with Assist: NOW and TODAY Functions in Tableau
  29. Advance with Assist: Sheet Swapping with Dummy Headers
  30. Advance with Assist: REST Error in Tableau and Snowflake Connection
  31. Advance with Assist: Mapping with One Data Row in Tableau 2019.2
  32. Advance with Assist: Multi-Number Formats for Single Calculations
  33. Advance with Assist: Removing Background Landmass on a Tableau Map
  34. Advance with Assist: Filtering Data Sources on Tableau Server
  35. Advance with Assist: Swapping Sheets in Tableau 2019.2
  36. Advance with Assist: Filling in Null Records Without Filtering
  37. Advance with Assist: Nested IF Calculations in Tableau
  38. Advance with Assist: Getting Show/Hide Buttons to Appear in Tableau Desktop
  39. Advance with Assist: Alteryx Output Error
  40. Advance with Assist: Missing Joins in Tableau 2020.2
  41. Advance with Assist: Tableau Server – Interactive MicroService Container Degraded
  42. Advance with Assist: A Shortcut for Duplicating Calculations
  43. Advance with Assist: Tableau Server License Renewal Refresh 
  44. Advance with Assist: Encrypt Tabcmd Credentials
  45. Advance with Assist: Pointing Tableau to a Named Range
  46. Advance with Assist: Tableau Server Migrations
  47. Advance with Assist: Adding ALL Selection to Parameters
  48. Advance with Assist: Uncaught Type Error in Tableau Server
  49. Advance with Assist: Site Roles Changing on Tableau Server
  50. Advance with Assist: Highlighting Points of Interest
  51. Advance with Assist: Finding Max Date and More
  52. Advance with Assist: Adding Field Names Above Bars on a Bar Chart
  53. Advance with Assist: Using Map Layers with Unconnected Data Sources

More About the Author

Danny Steinmetz

Analytics Consultant
InterWorks Wrapped 2023 It’s the most wonderful time of the year again. That’s right: Spotify Wrapped is finally here. The magical time where friends surprise ...
Web Content Accessibility Guidelines for Tableau As data grows more and more entrenched into everyday business decisions, the importance of questioning our data and how we interpret it ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!