Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 87 lines (72 sloc) 5.16 KB

Vector Tiles Attributes Extension

This extension defines a relationship between features of a vector tiles layer and vector tiles containing those features. When this extension is used, it is possible to perform a relational query and isolate only the vector tiles containing relevant features. In some circumstances this has the potential to greatly improve application performance.


The GeoPackage Related Tables Extension (RTE) defines the rules and requirements for creating relationships in a GeoPackage data store between geospatial data tables and other tables that contain or reference related content such as attributes or media. As an example, this can be used to establish a many-to-many relationship between features (e.g., points, lines, or areas) and multimedia files. By definition, the "left" side of the relationship is the "base" data and the "right" side of the relationship is the "related" data. The mapping table links related rows in those tables of those types by reference to their primary keys.

When relating vector tiles with the attributes of the features in those tiles, the base data is the vector tiles and the related data is the attributes as illustrated by Table Diagram. The "GeoPackage Extension for Related Tables" allows a GeoPackage to contain additional data that is related to geospatial (e.g., features) or attributes data. When relating tiled feature data with attributes, the tiled feature data is the "base" data and the attributes are the "related" data.

attributes ss
Figure 1. Table Diagram

The RTE does not define a requirements class to map tiles tables with attributes tables. This section defines a requirements class that will fill this need. A note has been added to the proposed RTE standard to indicate that additional requirements classes are possible. For information on using the Related Tables Extension, see the Getting Started Guide.


To use this extension, add the following rows to this table as described in gpkg_extensions.

Table 1. gpkg_extensions Table Rows
table_name column_name extension_name definition scope





name of actual User-defined Mapping Table





The values in the definition column SHOULD refer in some human-readable way to this extension specification. If the extension is adopted by OGC, it will gain the "gpkg_" prefix and get a different definition permalink.


This table describes extended relationships. The table requires the following columns:

Table 2. gpkgext_relations Table Rows
Column Description


primary key


Name of the vector tiles table


id (all user-defined tiles tables have this column)


Name of the user-defined attributes table


Name of the primary key column in related_table_name




Name of a User-defined Mapping Table

Add a row to this table for each vector tiles layer with attributes in an attributes table.


Set the attributes_table_name column to the appropriate table for each vector tiles layer with attributes in an attributes table.

User-defined Mapping Table

A user-defined mapping table describes the many-to-many relationships between base data (tiles) and related data (features). A user-defined mapping table requires at least the following columns:

Table 3. gpkgext_relations Table Rows
Column Description


tile ID (the primary key value of the base data table)


feature ID (the primary key value of the related data table)


By adding row to this table for each feature/tile instance, it is possible for a client to query for features by their attributes. However, full population of this table is not mandatory. It may be prudent to omit some entries for space reasons.

You can’t perform that action at this time.