Prepare your data for creating maps

Important

Before creating a map (if you are not using a geojson file), you must prepare table data by defining the appropriate geographic locations (setting the geography).

There are several different formats (described below) for defining geographic locations within spatial data:

  • Column-based geography
  • Row-based geography
  • Tracking geography

You can also define the geographic locations manually, by dropping pins, or drawing on a map, this will also be described below.

Column-based geography

Use column-based ‘set geography’ when different columns in a data file relate to different locations. This most commonly applies for a data file where all the data relates to a single type of measurement (e.g. temperature) with each column representing a different location and the rows representing different observations (time).

Example of column-based geography 

Note: Each location is defined in the column header.

Step 1: Click the “Data Wrangler” tab in the menu bar.

Step 2: Select the desired data from the left file tree whose geography is needed to be set.

Step 3: Select “Set Geography” from the right side in the meta data area.

Step 4: In the Set geography pop up select ‘Column based geography’.


Step 5: You have two options for defining the geography:

  • Auto -Select the geography from another file – click ‘select’ and browse a spatial file -geojson ( Note: Geojson file is the file which represents geographical features-e.g. “countries” in the image below). Truii will search the spatial file for any geometric properties that match the file name.

  • Manual – Setting the manual geography has been described in detail below. After setting the manual geography, you can view the marked area in Quick view tabs.

Note: column with some geography set will appear as blue – if you select one of these columns, the columns will appear blue and the geometry associated with the area will be blue on the map. You can edit the geometry using the map icons.

Step 6: Click ‘OK’ at the bottom of the popup to set the geography for the file. You have now set the geography for the file and are ready to put this on a map.

Row-based geography

The row based ‘set geography’ is used when different rows in a data file relate to different locations. This most commonly applies when the file contains a column of latitude and longitude values with each row of the table representing a different location.

Example of row-based geography 

Note: Each location is defined in the rows.

Step 1: Click the “Data Wrangler” tab in the menu bar.

Step 2: Select the desired data from the left file tree whose geography is needed to be set.

Step 3: Select “Set Geography” from the right side in the meta data area.

Step 4: In the set geography pop up select ‘Row based geography’.

Step 5: You have different options for defining the geography:

  • Geo Units:
  • Auto -Select the geography from another file – click ‘select’ and browse a spatial file -geojson ( Note: Geojson file is the file which represents geographical features-e.g. “countries” in the image below). Truii will search the spatial file for any geometric properties that match the file name.

  • Auto Search: It is an automated lookup of a web address service. Click ‘Auto search’ select columns that relate to an address (e.g. country, state, street).

  • Use default geo units:This approach uses any self-contained (latitude and longitude columns within the file) geographic information to define the geometry.
  • Manual –Setting the manual geography has been described in detail below. After setting the manual geography, you can view the marked area in quick view tabs.

Note: Rows with some geography set will appear as blue– if you select one of these rows, the row will appear blue and the geometry associated with the row will be blue on the map. You can edit the geometry using the map icons.

Step 6: Click ‘OK’ at the bottom of the popup to set the location for the file. You have now set the location for the file and are ready to put this on a map.

Tracking-based geography

The tracking based ‘set geography’ is used when different rows in a data file relate to different locations and times – such as tracking a route. This file structure would have columns of latitude, longitude and time values with each row of the table representing a different location and time.

Step 1: Click the “Data Wrangler” tab in the menu bar.

Step 2: Select the desired data from the left file tree whose geography is needed to be set.

Step 3: Select “Set Geography” from the right side in the meta data area.

Step 4: In the Set geography pop up select ‘Tracking based geography”.

Step 5: You have two options for defining the geography:

  • Tracking targets – Select columns to use as the keys for defining each tracking target (the ‘name’ column in the above example).

  • Use default tracking targets – As you load the set tracking popup, Truii will attempt to apply this approach by looking for likely columns that can be used to describe the tracking targets.

Note: The identified tracking targets are shown in the bottom right.

Step 6: Click ‘OK’ at the bottom of the popup to set the geography for the file. You have now set the geography for the file and are ready to put this on a map.

Set geography manually

There are basic geographic features that you can add while setting the geography manually: line, polygon, rectangle or marker. You can have any combination of these geographic features. For example, a single column of data might represent data from two different regions.

Step 1: Click the “Data Wrangler” tab in the menu bar.

Step 2: Select the desired data from the left file tree whose geography is needed to be set.

Step 3: Select “Set Geography” from the right side in the meta data area.

Step 4: In the Set geography pop up select any geography type which you want.

Step 5: Select the element that you want to specify the geography for:

  • For column based mapping, select the column that you wish to set the geography for (bottom left list on the set geography page).
  • For row based mapping – select the entity from the same list.
  • For file based mapping there is nothing to select, the geography will apply to the entire file.

Step 6: Draw the geometry on the map

  • Select the relevant geometry icon (line     , polygon  , rectangle (simple rectangular polygon or marker ).
  • Draw on the map using left mouse clicks – follow the prompts (e.g. click on first point to close a polygon).
  • Add as many features as you like to represent the geography of the element.
  • The geographies are saved as you create them.

Step 7: You can also “Edit” the geographic features. To edit the geographic features (including those that have been mapped from another file) – select the column.

  1. To Edit:
    Click the edit feature icon .
  • For polygons you can move the entire polygon by selecting the centre of the polygon.
  • You can edit any of the vertices by grabbing the vertices and dragging them.
  • For lines – move the whole line or the vertices of the line.
  • For markers – simply select and drag them to the desired location.
  1. To Delete:
    Click the Delete feature icon  . click on the features that you wish to remove. To confirm the feature deletion- click ‘save’ next to the delete icon.

Step 8: Click ‘OK’ at the bottom of the popup to set the geography for the file. You have now set the geography for the file and are ready to put this on a map.