Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw rectangular bounding boxes on map with Max/Min coordinates

Tags:

tableau-api

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)
like image 265
Chris Decker Avatar asked Feb 20 '26 02:02

Chris Decker


1 Answers

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

like image 170
tim Avatar answered Feb 25 '26 23:02

tim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!