Last Modified Date: 19 Jan 2023
- Download the attached LongitudeLatitudeTestData.xlsx file, which you will find in the upper right-hand corner of this article under "Attachments". See "Additional Information" section below for notes about how longitude/latitude data needs to be formatted. If the data isn't formatted correctly the option in steps 3 and 4 won't be appear.
- In Tableau Desktop, connect to LongitudeLatitudeTestData.xlsx. For more information, see Connect to Data.
- In Measures, right-click Ln, and then select Geographic Role > Longitude.
- In Measures, right-click Lt, and select Geographic Role > Latitude.
- Drag Ln to the Columns shelf.
- Drag Lt to the Rows shelf.
- Drag Place to Detail on the Marks card.
- The longitude and latitude must be separate fields in the data source.
- The longitude and latitude fields in the data source must numeric data with one decimal place. This is the "Decimal Degrees" (DD) format, but excluding text characters like ° or N.
- Converting a value in DD format like 45.7811111° N so that Tableau will recognize it can be done with a calculation like FLOAT( LEFT( [Latitude], LEN( [Latitude] ) - 3 ))
- If the longitude and latitude data is another format, it may require a more complex calculation to convert. For example, to convert from Degrees Minutes Seconds (DMS) to DD you will need the following formula: DD = degrees + (min/60) + (sec/3600)
- The example data contains the latitude and longitude values for West Virginia, Virginia, and Maryland. The field and state names are altered so that Tableau Desktop will not automatically recognize them as geographic locations.
Discuss this article... Feedback Forum
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials