Geographic location and geocoding
To show data on a map, the data must either be geocoded or directly contain coordinates such as longitude or latitude. Geocoding in Spotfire means that some identifiers in a data table are used to match against similar identifiers in another set of data tables (a geocoding hierarchy) which contains latitude/longitude coordinates or geographic features. These coordinates or features are then used for correctly positioning the data in a map context. If your data contains simple geographic elements such as country names, states, or similar, then Spotfire will attempt to automatically geocode your data. If no automatic geocoding can be performed, you can configure the geocoding manually instead.
By specifying that a column in a data table should be used to match against a specific geocoding hierarchy you can make the process of setting up a map chart with that data easier.

In this example, the state column is automatically identified as US States and the data is correctly positioned on the map.
Automatic geocoding and hierarchies
A geocoding hierarchy is a collection of ordered geocoding tables that can give you the opportunity to drill down to a more detailed level when zooming in on the data. The hierarchy should contain all geocoding tables that the layer should be allowed to choose from when applying geocoding, and it should preferably be a geographic hierarchy with different level of detail, such as:
- Table 1: US States (a table containing state geometries identified by state names (and/or codes).
- Table 2: US Counties (a table containing county geometries identified by the full state/county hierarchy).
Spotfire automatically adds (hidden) geocoding data tables if you add a map chart for a data table where geographical names can be found. When selecting the best suited geocoding table, Spotfire checks the expression on the Geocode by/Marker by or Feature by-axis and chooses the geocoding table to which the geocoding primary key columns can be matched using column matching. If only State is used on the axis, the US States table would be selected, but if both State and County are used on the axis, then the US Counties table is selected.
Once Spotfire has chosen a geocoding table, the visualization downloads and joins in that table in the map chart based on the found column matches.
Manual geocoding
When you are manually setting up geocoding you must consider which columns in your data can be used to identify the location of the data. For example, this could be a State column or a State/County hierarchy. Note that the level at which you select to show your data is the one that should be used for geocoding, because the Marker by axis and the Geocoding by axis in map charts are the same in marker layers. Hence, if you want to show data for different states you must geocode by state and not by counties.
You can specify the geocoding type and representation for a selected column in your analysis by clicking on the column in the Data in analysis flyout and, in the Column settings view of the expanded flyout, choosing a suitable Geocoding property or hierarchy. You can easily specify that a column contains either longitude or latitude values, geometries, or some hierarchical location. See also Specifying new geocoding tables.

You can also try using the Auto-match option (available under the Geocode by settings) to try to match on the content of the column rather than on the column name, if you know that your data contains common locations but the column names in the data table do not match any of the columns in the available geocoding tables.
Manual updates of visualization properties
If you add a map chart visualization and the automatic geocoding does not work as expected, or if you want a certain visualization to use other geocoding hierarchies than the rest of the map charts in the analysis, you can tweak some geocoding settings from the visualization properties for the marker layer or feature layer in question. See Adding a marker layer and Adding a feature layer for information about the layer types.
You have the option to switch to a different geocoding hierarchy in the library directly from the visualization properties. In the visualization properties panel, click in the Geocode by card. In the installed client, use the Add drop-down list on the Positioning page. You can also choose to add a completely new (in-memory) data table to be used in the geocoding hierarchy. You can use Auto-match to match on column content, as described above.
If needed, you can edit column matches between the data layer and the geocoding data tables in the visualization.
If a geocoding table included in the hierarchy is not automatically downloaded from the library, then this is indicated in the list. Click to select the geocoding table of interest and then click Load to load the table into the analysis. Note that the currently used geocoding table might change for a visualization, if a hierarchy is used and the hierarchy level is modified using a slider.
Removing a geocoding table from the Geocoding hirerarchy list in the visualization properties only specifies that the table should not be used for geocoding in the current layer. All loaded geocoding tables will remain in the analysis until you explicitly remove them from the Data canvas.
Geocoding hierarchies in the library
A set of default geocoding hierarchies is shipped with Spotfire Server as a zip archive which a library administrator can import into the library. Each hierarchy consists of a number of geocoding tables. Once imported, the geocoding hierarchies are normally located in the GeoAnalytics folder in the library. Because most of these geocoding tables contain geographic shapes, they can also be used as feature layers in your map chart. The geocoding hierarchies located in the library will show up in the list when you choose to add a new marker layer of feature layer in a map chart.
You can also add your own geocoding tables to the library by following the instructions in Specifying new geocoding tables.
Disabling automatic geocoding for a specific data file in the library
It is possible to specify that the data in a large SBDF file in the library should not be automatically downloaded (to be used for geocoding) by other data tables from the Edit Properties dialog for the library file.
On the Geocoding tab, clear the Allow automatic download check box.
If geocoding tables are not automatically downloaded they can still be added at a later stage from the Positioning or Geocoding sections in the visualization properties for the map chart layer in question.
Disabling automatic geocoding (in an on-premises environment)
A Spotfire on-premises Administrator can disable auto-loading of
geocoding tables completely for a group of users by setting the
AutoloadGeocodingTables preference to
False. This preference is found in the installed
client by selecting
. Go to the
Preferences tab, and look in the
MapChartPreferences group to locate the preference.
This can be desired if the group is on a slow connection or if the system repeatedly makes unwanted geocoding matchings.
- Specifying new geocoding tables
Spotfire comes with a selection of geocoding hierarchies that are either stored in the library (for on-premises environments) or saved locally. You can also define your own geocoding tables using shapefiles (.shp), GeoJSON files (.geojson), or data tables with categorical (usuallystring) hierarchies, and save them in the library, or locally, for future use. This is accomplished by setting a number of data table and column properties on the geocoding table in Spotfire. - Configuring an information link with map data
When the geographical data is located in a database and an information link is used to retrieve the data, you must perform the a number of steps when creating the column elements if you want the end users of the information link to be able to create map charts without further configuration. - Configuring WKB data for use with maps
When geographical data is located in a Well-Known Binary (WKB) column, but not originating from a shapefile or GeoJSON file, you can manually create the required coordinate columns using the spatial functions in the expression language in the add calculated column tool.