Skip to content

DTVF Data v2.0.0

Michael Hillman edited this page Jun 29, 2022 · 6 revisions

This page is a work in progress.

Configuration Files

In addition to the actual data (whether it's being provided in local files or via a remote endpoint), the visualisation requires a number of configuration files to function. These files need to be hosted relative to the base URL of the stack (or base directory of local files) and have the exact names detailed below.

visualisation.json:

This file is required and lists the definitions of grouped data sources and map layers to show on the visualisation. Each group within this JSON file defines a list of sources and layers to make up what the visualisation plots; these sources and layers are defined using the format provided by the MapBox API (sources, layers). However, a few additional properties are required:

  • id: Sources & Layers. This property is the unique back-end name for the source/layer.
  • name: Layers only. This is the user facing name of the layer and can be reused to group individual layers into a single tree option.
  • clickable: Optional, Layers only. Set to false to disable all mouse interactions
  • treeable: Optional, Layers only. Set to false to prevent adding a tree entry for this layer.

For a working example of a visualisations.json file, view the example-visualisation.

Using GeoJSON Files

GeoJSON files can be used by the DTVF to specify the locations of features. At the time of writing, it's intended that GeoJSON files only contain the locations of features and a small amount of visualisation properties; metadata to be shown in the visualisation side panel will be accessed via a standalone HTTP agent.

GeoJSON files for use with the DTVF are expected to follow the standard GeoJSON format with a few small additions. Each feature (i.e. location) within a GeoJSON file should have:

  • A numerical id field that is unique across all features within that file. That id field should also be nested within the feature node, but not within the properties group (this format is required by some of our mapping library's additional features).
  • A name property. This is the field that the visualisation will use for the user facing name of the location.
  • An optional description property can also be provided; by default, the name and description field (if present) will be displayed when the user hovers their mouse over the location.
  • An optional thumbnail property can also be provided; if this is a URL to an image, it can be displayed when the user hovers their mouse over the location.

Each GeoJSON should contain a single type of location (i.e. do not mix Points with Polygons or LineStrings), and will be represented by a single map layer.

Wherever possible, GeoJSON files should also be encoded with UTF-8.