gpkg_extensions system table so that any conformant reader knows which extensions are in use.
How Extensions Are Registered
Every extension registers one or more rows in thegpkg_extensions table. A row captures:
table_name– the table the extension applies to (orNULLfor a file-level extension)column_name– the specific column affected (orNULL)extension_name– a namespaced identifier in the formauthor_name(e.g.gpkg_rtree_index,nga_feature_style)definition– a URL pointing to the extension specificationscope– eitherread-writeorwrite-only
read-write extension should treat the file as potentially invalid for their use case. write-only extensions can be safely ignored by read-only consumers.
Managing Extensions
ExtensionManager
ExtensionManager is the central coordinator for all GeoPackage extensions. It delegates to registered ExtensionManagement implementations and handles bulk operations like deleting or copying all extensions for a table.
NGAExtensions
NGAExtensions manages the suite of community extensions developed by the National Geospatial-Intelligence Agency (NGA). It is automatically registered with ExtensionManager and handles the geometry index, tile scaling, feature styles, contents ID, and feature-tile link extensions.
NGA extensions are community extensions and use the author prefix
nga_. They are not part of the core OGC GeoPackage specification but are widely supported.Available Extensions
RTree Spatial Index
OGC extension (
gpkg_rtree_index). Stores a SQLite R*Tree virtual table for fast bounding-box spatial queries on feature geometry columns.Related Tables
OGC community extension (
gpkg_related_tables). Defines many-to-many relationships between any two GeoPackage tables using mapping tables and an gpkgext_relations catalog.Feature Style
NGA extension (
nga_feature_style). Associates visual style rules (color, width, fill, icons) with feature tables and individual feature rows for rendering.Metadata
OGC extension (
gpkg_metadata). Attaches structured metadata documents (ISO 19115, Dublin Core, etc.) to the GeoPackage, individual tables, columns, or specific rows.Additional NGA Extensions
| Extension | Author | Description |
|---|---|---|
| Geometry Index | nga | Alternative geometry index stored in GeoPackage extension tables (nga_geometry_index). Useful when SQLite RTree is unavailable. |
| Contents ID | nga | Assigns stable integer IDs to GeoPackage contents entries for use by other extensions. |
| Tile Scaling | nga | Configures zoom-level scaling strategies for tile layers. |
| Feature-Tile Link | nga | Links feature tables to corresponding tile tables for coordinated rendering. |
| Properties | nga | Stores key-value property metadata about the GeoPackage itself. |
| Schema | gpkg | Documents column-level metadata including data types, constraints, and human-readable names via gpkg_data_columns. |
| CRS WKT | gpkg | Adds Well-Known Text (WKT) representations for coordinate reference systems beyond those built into the core spec. |