5 Replies Latest reply on Feb 27, 2016 3:57 AM by Shawn Wallwork

    Plotting city data but retaining only US map with state borders

    Kurt Heisler

      I know that Tableau doesn't support filled maps for the City geographic role, but I hope it still allows you to create a clean US map (i.e., washout = 100% so you see only crisp state borders and no other countries) that shows the 50 states, Alaska, and HI and a dot for any city data. 

       

      For example, I have data like this:

       

      State  City            Grantee

      AL      Alabaster   ABC Grant

      CA     Alameda     XYZ Grant

      HI       Honolulu     HYT Grant

       

      I'd like a clean US map (i.e., clearly defined state borders, no Mexico, no Canada, etc.) and a dot in each city where there is a grant. I don't need city boundaries drawn. Because the city data is plotted, when you set Washout = 100% everything but the plots for city data vanishes. 

       

      Thanks! 

        • 1. Re: Plotting city data but retaining only US map with state borders
          Shawn Wallwork

          Something like this:

           

          See 9.2 workbook attached.

           

          --Shawn

          3 of 3 people found this helpful
          • 2. Re: Plotting city data but retaining only US map with state borders
            Kurt Heisler

            Perfect! Thank you. I was on the right track but overstepped some things. For those interested:

             

            1. Right click on your State variable > Add to sheet. This will generate your state map with longitude (Columns) and latitude (Rows) coordinates.

            2. On the Marks card, change Automatic to Filled Map

            3. On the menu: Map > Map Layers > slide Washout to the right so it's 100%. This will leave only the US states and state borders.

            4. In the Measures pane, drag Latitude (generated) to the Rows shelf. You now see two maps.

            5. Right click on the Latitude pill you just dragged to the Rows shelf > Dual axis. You're now back to one map.

            6. At the bottom of the Marks card, you'll see two Latitude (generated) items. The first occurred in step 1. The second occurred in step 5. Click on the second one.

            7. Right click on your City variable > Add to sheet.

            8. Change Filled Map to Circle.

             

            You should now have a clean US only map with state borders and circles for your city data.

             

            Optionally: To change the background color of the US map (by default the states and city cirles are blue), click on the first Latitude (generated) item on the Marks card. Click Color and select the desired color (e.g., white).

            4 of 4 people found this helpful
            • 3. Re: Plotting city data but retaining only US map with state borders
              Shawn Wallwork

              You got it all! Good job. If you want to add HI and AK then create those as separate maps and float them as appropriate over the main map on a dashboard.

               

              Cheers,

               

              --Shawn

              • 4. Re: Plotting city data but retaining only US map with state borders
                Kurt Heisler

                Ran into an issue.

                 

                For example, in your map, add City to Filters and deselect Fargo. When you do this, the state of North Dakota disappears, presumably because Fargo was the only data point for ND.

                 

                I suspect this is due to how Tableau handles filters in general.

                 

                I do want to filter on various data points, so I need to prevent certain states from vanishing and causing geographical panic. Is the best solution to insert a background image of a US map and plot only the City points (so they're layered on top of the background image of a US map)? I tried this by taking a screenshot of the US map generated with the State data, but without showing the City plots. I then went to Map > Background Images > ... and browsed to my screenshot. But I couldn't figure out what Left and Right values to use for the X (Longitude) and Y (Latitude) fields. I was studying this tutorial:

                 

                http://onlinehelp.tableau.com/current/pro/online/windows/en-us/bkimages_add.html

                 

                Any suggestions?

                • 5. Re: Plotting city data but retaining only US map with state borders
                  Shawn Wallwork

                  Probably the best solution is to use Mapbox to create the background map with the border setup like you want them. Then connect to that map. There are a lot of resources out there, including a TDT. The best place to start is a Google search on:

                   

                  tableau software mapbox

                   

                  --Shawn