Background maps in Tableau provide useful functionality for both internal and external mapping tasks. Mapping company premises both inside and is one common usage for such maps and this can be achieved within Tableau itself. You can find instructions on how to do this here. This involves annotating the image with the points:
Then copying these points to Excel and assigning identifiers to the points.
Whilst this is fine for demos and small projects to use this method on larger and more complex maps is fiddly, tiresome and very difficult to get professional looking results where everything is aligned properly and can be easily edited and shared.
This is where the free and open source tool QGIS comes in. With this you can produce professional layouts which are editable and shareable.
Here is how to create simple points using QGIS.
1.Download and install QGIS from here.
2. Add your background image as a new raster layer:
3. Accept the default Coordinate Reference System (CRS) which is WGS84. Because QGIS is a geospatial tool the images are referenced to a specific projection so they can be used in geographic mapping contexts. This isnât actually what we want, we need the coordinates to be relative to the size of the image we are using so will use a workaround in step 7
4. Add a new shapefile layer for our points:
Choose type Point. Remove the default âidâ attribute from the list. Add a new attribute named ID with type of Text data. Add to attribute list.
Select OK and Save the file when prompted.
5. Make sure the Tableau Points layer is selected and select the Toggle Editing icon:
6. Select the Add Feature icon and add your points to the image:
7. When you have added all your points right click on theÂ background image layer in the layers panel and select properties. Select metadata and find the X and Y dimensions of your image in the Properties box. Mine are 1051 and 887:
8. Right click on the points layer and select Open Attribute Table
9. Open the field calculator Â Â
Create a new field X as type decimal and precision of 2. In expression enter $x
Create another field as above named Y with same type and number width and precision. In expression enter:
Now you will get your coordinates in the attribute list:
Which you can copy to clipboardÂ
And paste into Excel. Add an
extra row for the full size of image, in this case 1051 and 887
10. Open up a Tableau workbook and connect to the workbook. Go to Map> Background Images >
11. After adding X to Columns shelf and Y to Rows shelf and ID to level of detail then you should get your points on the Image. Right click each axis and uncheck Show Header and select a suitable mark.
Next time I will show how to go deeper into QGIS and how to get centered points and speed up the process of adding many points.