Spotfire® User Guide

Aggregating coordinate-based locations values

If geographic coordinates are available in the data loaded into a marker layer in the map chart, each marker is positioned at its coordinates. But you might not be interested in separate markers; instead an aggregated value representing multiple markers might be of interest.

The most common way to position markers is by geocoding. Then, you can aggregate values by moving up one level in the specified geographic hierarchy. For example, if the columns you use for geocoding are Country > City, you simply remove the "City" column to get a marker representing the aggregated value for all the cities in each country.

If you want to aggregate values for markers positioned using coordinates, first check whether geocoding can be used instead.

In the visualization properties panel, click Add and select Geocode by. If a suitable column with geographical names is available in the data table used by the marker layer, select it in the column selector. For example, this could be a column such as Country (or State), or ZIP code.

Depending on what data you have in your analysis, you might also need to add a geocoding table (from a file or from the library) to get the correct mapping. See Geographic location and geocoding for more information.

In the installed client, you can also use the visualization properties dialog, locate the Positioning page in the Marker Layer Settings and, under Position markers using, choose Geocoding to enable this functionality:

However, if no such columns are provided in your data, see the example of a possible solution below.

Example: Aggregating while keeping coordinate positioning on axes

The data below contains house prices for four different objects. Two of the objects are located by the sea, and two of them are further into the land. Note that no columns with geographical names are available, only coordinates.

Below, the data is loaded into a map with the objects placed at their coordinates (labels show the prices), and the visualization properties panel is open to the right of the map:

Assume you wish to compare the average price of houses with a sea view, to houses without. Geocoding is not an option, because no column contains geographic names.
Instead, select "Area" on the Marker by selector to aggregate values per "Area" type. Then, the X- and Y-column values must also be aggregated; otherwise each of the four coordinates will still be shown. The best aggregation method is probably average, as shown below:

The markers are now placed on an average position based on the latitude and longitude for each area type.

Note: The labels in this example have been manually updated to show the average price for the aggregated markers. You specify labels in the Labels section of the visualization properties.