Skip to content

Latest commit

 

History

History
74 lines (59 loc) · 2.94 KB

2f_attributes.adoc

File metadata and controls

74 lines (59 loc) · 2.94 KB

Attributes

Introduction

Non-spatial attribute data are entities (e.g., tuples or rows) of observations that may not have an explicit geometry property. In GeoPackage, this data is stored in user-defined attribute tables. These tables may contain properties such as an ID or geo-locatable address that allow them to be relationally linkable to rows in other attribute, feature or tile tables.

Examples of attribute data include:

  • meteorological readings from a weather station

  • flow readings from a stream gauge

  • traffic volumes from embedded highway sensors

  • lists of customers

  • delivery stops

  • work orders

Contents

Data
Contents Table - Attributes Row
Requirement 118

The gpkg_contents table SHALL contain a row with a data_type column value of "attributes" for each attributes data table or view.

Attributes User Data Tables

Data
Table Definition

Non-spatial attribute data is stored in user-defined Attribute tables. Attribute sets are rows in an Attribute table. The attributes are columns in a Attribute table. (A GeoPackage is not required to contain any Attribute data tables. Attribute data tables in a GeoPackage may be empty.)

Requirement 119

A GeoPackage MAY contain tables containing attribute sets. Every such attribute table SHALL be structured consistently with Table 1 and [example_attributes_table_sql]. A table SHALL have a primary key column of type INTEGER and that column SHALL act as a rowid alias.

Note

The integer primary key of an attributes table allows features to be linked to row level metadata records in the gpkg_metadata table by rowid [B5] values in the gpkg_metadata_reference table as described in clause [_metadata_reference_table] below.

Requirement 151

A GeoPackage MAY contain views containing attributes. Every such attributes view SHALL have a first column of type INTEGER and that column SHALL contain unique values for each row.

Note

Since the concept of primary keys does not exist for views in SQLite, this requirement provides a way to produce a compliant attributes view with a discoverable key-like column[K17].

Table 1. Sample Attributes Table Definition
Column Name Col Type Column Description Null Key

id

INTEGER

Autoincrement[K6a] primary key

N/A[K6b]

PK

text_attribute

TEXT

Text attribute of feature

yes

real_attribute

REAL

Real attribute of feature

yes

boolean_attribute

BOOLEAN

Boolean attribute of feature

yes

raster_or_photo

BLOB

Photo of the area

yes