Skip to content

Instantly share code, notes, and snippets.

@rcoup
Last active August 29, 2015 14:02
Show Gist options
  • Save rcoup/8d79a28fb3374082646e to your computer and use it in GitHub Desktop.
Save rcoup/8d79a28fb3374082646e to your computer and use it in GitHub Desktop.
Proposal - GeoPackage Aspatial Support Extension

Extension Title

Aspatial Support

Introduction

Support for aspatial data (ie. SQLite tables/views without a geometry column), potentially with associated metadata.

Extension Author

GDAL - Geospatial Data Abstraction Library, author_name gdal.

Extension Name or Template

INSERT INTO gpkg_extensions
  (table_name, column_name, extension_name, definition, scope)
VALUES
  (
    NULL,
    NULL,
    'gdal_aspatial',
    'http://gdal.org/geopackage_aspatial.html',
    'read-write'
  );

Extension Type

Extension of Existing Requirement in Clause 2.

Applicability

This extension applies to any aspatial user data table or view specified in the gpkg_contents table with a lowercase data_type column value of "rows".

Scope

Read-write

Requirements

GeoPackage

Contents Table - Rows

The gpkg_contents table SHALL contain a row with a lowercase data_type column value of "rows" for each aspatial user data table or view.

User Data Tables

The second component of the SQL schema for aspatial tables in an Extended GeoPackage described in clause 'Contents Table - Rows' above are user tables that contain aspatial user data.

An Extended GeoPackage with aspatial support is not required to contain any user data tables. User data tables MAY be empty.

An Extended GeoPackage with aspatial support MAY contain tables or updateable views. Every such aspatial table or view MAY have a column with column type INTEGER and PRIMARY KEY AUTOINCREMENT column constraints per EXAMPLE.

Column Name Type Description Null Default Key
id INTEGER Autoincrement primary key no PK
text_attribute TEXT Text attribute of row yes
real_attribute REAL Real attribute of row yes
boolean_attribute BOOLEAN Boolean attribute of row yes
raster_or_photo BLOB Photograph yes

An integer primary key of an aspatial table allows features to be linked to row level metadata records in the gpkg_metadata table by rowid values in the gpkg_metadata_reference table as described in clause 2.4.3 Metadata Reference Table.

An aspatial table SHALL not have a geometry column.

GeoPackage SQLite Configuration

None

GeoPackage SQLite Extension

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment