gpkg_metadata) provides a standard mechanism for embedding metadata documents inside a GeoPackage. Metadata is stored in the gpkg_metadata table and linked to GeoPackage objects (the file, specific tables, columns, or rows) through the gpkg_metadata_reference table.
This is an OGC-registered extension defined at http://www.geopackage.org/spec/#extension_metadata.
Core Tables
| Table | Purpose |
|---|---|
gpkg_metadata | Stores the raw metadata documents (XML, JSON, text, etc.) |
gpkg_metadata_reference | Links metadata documents to GeoPackage objects |
Key Classes
MetadataExtension
Manages the lifecycle of the extension itself (registration, table creation, removal).
Metadata
A row in gpkg_metadata. Stores the document content and describes its encoding.
Auto-assigned primary key.
Scope string from
MetadataScopeType (e.g. 'dataset', 'table'). Describes what the metadata applies to.URI identifying the metadata standard (e.g.
http://www.isotc211.org/2005/gmd for ISO 19139).MIME type of the encoded metadata (e.g.
text/xml, application/json).The raw metadata document content.
MetadataReference
A row in gpkg_metadata_reference. Links a Metadata document to a specific target object.
One of the
ReferenceScopeType values: geopackage, table, column, row, row/col.Target table name.
NULL when reference_scope is geopackage.Target column name. Set only for
column or row/col scopes.Target row ID. Set only for
row or row/col scopes.Foreign key to
gpkg_metadata.id.Optional foreign key to a parent
gpkg_metadata.id for hierarchical metadata.MetadataScopeType Values
The scope describes what entity the metadata document is about:
All MetadataScopeType values
All MetadataScopeType values
| Value | String | Description |
|---|---|---|
UNDEFINED | undefined | Scope is undefined |
FIELD_SESSION | fieldSession | Applies to a field data collection session |
COLLECTION_SESSION | collectionSession | Applies to a collection session |
SERIES | series | Applies to a dataset series |
DATASET | dataset | Applies to a geographic feature dataset |
FEATURE_TYPE | featureType | Applies to a feature type (class) |
FEATURE | feature | Applies to a single feature instance |
ATTRIBUTE_TYPE | attributeType | Applies to an attribute class |
ATTRIBUTE | attribute | Applies to a feature attribute |
TILE | tile | Applies to a tile |
MODEL | model | Applies to a model |
CATALOG | catalog | Applies to a feature catalog |
SCHEMA | schema | Applies to an application schema |
TAXONOMY | taxonomy | Applies to a taxonomy or knowledge system |
SOFTWARE | software | Applies to software |
SERVICE | service | Applies to a service |
COLLECTION_HARDWARE | collectionHardware | Applies to collection hardware |
NON_GEOGRAPHIC_DATASET | nonGeographicDataset | Applies to non-geographic data |
DIMENSION_GROUP | dimensionGroup | Applies to a dimension group |
STYLE | style | Applies to a specific style |
ReferenceScopeType Values
Controls what GeoPackage object a MetadataReference row points to:
| Value | String | Points to |
|---|---|---|
GEOPACKAGE | geopackage | The entire GeoPackage file |
TABLE | table | A specific table |
COLUMN | column | A specific column in a table |
ROW | row | A specific row in a table |
ROW_COL | row/col | A specific cell (row + column) |