Note

This documentation is for a prior release of Kinetica. For the latest documentation, click here.

Vector Tile Service

Overview

Kinetica provides a Vector Tile Service (VTS) to generate Vector Tiles and support client-side visualization of the geospatial data contained within the tiles. The Vector Tile format generated follows the open standard Mapbox Vector Tile specification. The Kinetica VTS feeds a client-side Vector Tile renderer, such as Mapbox GL, by adding the VTS URL to the renderer's style configuration as a map layer source. Any Kinetica table that is defined with at least one WKT-type (geometry) column can be used as the data source for the layer parameter. Input geometries are pre-processed upon ingestion for faster vector tile generation. The data source, geographical position, and zoom level of each Vector Tile are specified in a VTS request. The requested Vector Tile is then returned in the response.

The VTS offers a couple advantages over server-side WMS calls:

  • VTS supports client-side control of styling like image fill
  • When using vector tiles, the browser only requests new information as needed and caches data along the way; WMS output must be re-rendered on every pan/zoom

Configuration

Before using the VTS, the service must be enabled and configured via the gpudb.conf configuration file.

Settings:

NameDefaultDescriptionAllowable Values
enable_vectortile_servicefalseEnables the database VTS to support client-side visualization of geospatial data.true or false
min_vectortile_zoomlevel1

Determines the minimum zoom level for vector tile pre-processing. As the value gets lower, more geographical area is rendered.

Note

A vector tile request for a lesser zoom level than this value will take additional time to process as the vector tile is generated on the fly.

Minimum is 0, maximum is 20.
max_vectortile_zoomlevel8

Determines the maximum zoom level for vector tile pre-processing. As the value gets higher, less geographical area is rendered but details more apparent (islands, rivers, roads, buildings).

Note

A vector tile request for a greater zoom level than this value will take additional time to process as the vector tile is generated on the fly.

Minimum is 0, maximum is 20.
vectortile_map_tilergoogleThe name of the map tiler used for VTS. The configuration for the VTS must match the configuration for the client-side renderer.
  • google (Mapbox)
  • tms (OpenLayers)

Usage

Base VTS URI:

http://<kinetica-host>:<port>/vts/<layer>/<z>/<x>/<y>?attributes=<columns>

Important

The VTS URL needs to be specified in the client-side visualizer's configuration.

URI parameters:

NameDescriptionAllowable Values
layerName of data source table.A valid table name, in [schema_name.]table_name format, using standard name resolution rules
attributesList of geometry column names.A comma separated list of column names of the data source table.
zZoom level of the requested tile.Non-negative integer. The maximum value is 30. Provide the parameter as {z} to have the client-side renderer dynamically set the value.
xHorizontal index of the requested tile.Non-negative integer. Provide the parameter as {x} to have the client-side renderer dynamically set the value.
yVertical index of the requested tile.Non-negative integer. Provide the parameter as {y} to have the client-side renderer dynamically set the value.

Example

Below is a snippet of a Javascript Mapbox style specification using Kinetica's VTS URL as a source:

// Config
var tableName = "nyc_neighborhood";
var wktColumn = "geom";
var kineticaUrl = "http://172.123.45.67:9191/vts/";

// Mapbox GL
map.on('load', function () {
  map.addLayer({
    "id": tableName + "_layer",
    "version": 8,
    "type" : "fill",
    "source": {
      "type": "vector",
      "tiles": [kineticaUrl + tableName + "/{z}/{x}/{y}?attributes=" + wktColumn], // Note Mapbox uses the params in curly braces as dynamic values. Don't change those.
      "maxzoom": 20
    },
    "source-layer": tableName,
    "paint": {
      "fill-color": "#EDF00F",
      "fill-outline-color": "#000000"
    }
  });
});

Limitations and Cautions

  • Vector tiles are kept in memory, so the zoom levels should be used to keep the memory usage of tiles at a reasonable level. A higher zoom level typically results in more tiles and more memory usage
  • Since VTS sends feature information for each table row to the browser, the client can get overwhelmed with data; performance is dependent upon client hardware