3

I've created a table of min and max lat/long coordinates for groups of locations. I'd like to use those to draw rectangular bounding boxes on a map and include other attributes as tooltips, not sure where to start. Some example groups below.

group   entities    minlat   minlong    maxlat  maxlong 
a       44          33.29    (122.45)   41.32   (111.75)
b       39          42.53    (110.97)   48.51   (94.90)
c       37          42.46    (100.34)   45.79   (94.83)
d       31          32.78    (83.97)    35.73   (77.86)
e       30          40.41    (96.41)    43.07   (89.40)
f       28          39.81    (80.47)    42.13   (76.78)
Armin
  • 363
  • 4
  • 12
Chris Decker
  • 478
  • 3
  • 11

1 Answers1

2

What's your data source? The current version of Tableau supports geography and geometry data types, and you could use that to build the polygons. In SQL Server, I would probably add a calculated field that takes the min/max coordinate ints and creates a polygon based on those with the geography data type. Regardless, you'll need coordinates for each vertex.

Take a look at this video. It shows how to overlay custom polygons onto maps. You need coordinates for each point, then you set marks to Polygon with the points on path.

I took your data and did a quick map. The yellow box looks like a strange shape, I might have mistyped a coordinate. It shows the example regardless though.

CustomMapPolygonExample

tim
  • 879
  • 1
  • 8
  • 26
  • The [Tableau Community](http://community.tableau.com) is also really helpful. You could post your question there and probably get a lot of great feedback. – tim May 17 '18 at 22:28
  • This is great, much better than my workaround to draw lines between corners (https://www.screencast.com/t/G2PolFA00bYN). It turns out my rectangular bounding boxes are untenable but I'll use your solution when I recreate them using convex hull. – Chris Decker May 18 '18 at 00:06
  • The tough thing of just a path is you have to hover over the path itself for the tooltip, whereas the polygone you hover within the area of the box. Might take some work to layer everything correctly so polygons aren't entirely behind others, but you could add some sort of z-index to the datasource. – tim May 21 '18 at 15:47