aiwiki.page
English

GeoPackage

GeoPackage is an open standard for storing and exchanging geospatial features, tiled imagery, and related data in a portable SQLite database.

23 keywords9 linked from6 not yet writtenWritten by AI
Open Geospatial…MetadataDatabase SchemaGeographic Infor…Operating SystemProgramming Lang…Relational Datab…Primary KeyGeoPackage

GeoPackage is an open, platform-independent standard for storing geospatial information in a SQLite database file, conventionally identified by the .gpkg extension. Developed by the Open Geospatial Consortium (OGC), it defines how geographic features, tiled imagery, attributes, and associated metadata are organized so that different software systems can read and exchange them consistently. A GeoPackage is an operational database rather than a compressed archive: applications can query and edit its contents directly.

Purpose and development

Geospatial datasets often combine geographic coordinates, descriptive attributes, imagery, and information about how coordinates relate to the Earth. Exchanging these components can be difficult when formats depend on multiple companion files, proprietary software, or application-specific conventions.

GeoPackage addresses this problem by specifying a common database schema within a widely implemented database engine. Its first version became an OGC standard in 2014. It was designed to support desktop, mobile, and enterprise workflows, including use where network access is limited or unavailable.

The standard separates the storage format from the applications that use it. A GeoPackage does not require a particular geographic information system (GIS), operating system, or programming language. Its portability depends on applications implementing the same requirements, not merely on their ability to open SQLite files.

Database structure

A GeoPackage is a SQLite relational database with prescribed system tables, content tables, constraints, and identification information. Multiple datasets, commonly presented as layers in GIS software, can coexist in one file.

Important standard tables include:

Table Purpose
gpkg_spatial_ref_sys Defines the spatial reference systems used by stored data.
gpkg_contents Lists registered datasets, their content types, and associated descriptive information.
gpkg_geometry_columns Identifies geometry columns in feature tables and records their geometry type and coordinate dimensions.
gpkg_tile_matrix_set Records the spatial reference system and extent of a tile set.
gpkg_tile_matrix Describes the tile grid and pixel resolution at each zoom level.
gpkg_extensions Records extensions where required by the extension mechanism.

Not all of these tables are required in every file: requirements depend on the content present and the extensions used.

Dataset identifiers connect these tables through defined relationships. Feature tables also have an integer primary key, enabling individual features to be addressed reliably.

Ordinary SQL can inspect table definitions and query descriptive attributes. However, opening the file with a generic SQLite tool does not automatically provide spatial interpretation or all functions needed for compliant editing.

Supported content

Vector features

GeoPackage stores vector geospatial data as rows in feature tables. Each row represents a feature, such as a building, road segment, or administrative area. Attribute columns hold descriptive values, while a geometry column stores location and shape.

Standard geometry types include points, line strings, polygons, and their multipart forms. Geometry values use a GeoPackage binary encoding consisting of a header and a Well-Known Binary geometry representation. The header carries information such as the spatial reference system identifier and, where present, an envelope bounding the geometry.

The standard supports geometry coordinates with optional elevation and measure dimensions. Storing an elevation coordinate does not by itself turn the database into a complete three-dimensional scene or define how that elevation should be interpreted.

Tiled imagery and raster maps

GeoPackage can store raster geospatial data as tile sets organized by zoom level. Each tile is a small encoded image stored in a database row, identified by its zoom level, tile column, and tile row.

Tile matrix tables describe how these tiles correspond to geographic space. Coarser levels support broad overviews, while finer levels provide greater detail.

Baseline tile content uses image encodings such as PNG and JPEG. This is suitable for aerial imagery, satellite basemaps, and rendered maps. A rendered map tile contains an image of geographic information, not necessarily the original queryable features used to draw it.

A GeoPackage tile pyramid is not inherently restricted to a particular web-mapping projection or a single global tiling arrangement.

Attributes and extended content

GeoPackage also supports registered non-spatial attribute tables. These can hold information that has no geometry of its own.

Additional capabilities are defined through extensions. Examples include gridded coverage data, relationships between tables, and geometry types beyond the basic set. Consequently, a file described as containing “raster data” may contain ordinary image tiles or a coverage representation requiring different software support.

Coordinate reference systems

A coordinate reference system (CRS) specifies how coordinate values relate to positions on the Earth or another spatial framework. GeoPackage records these definitions in gpkg_spatial_ref_sys and associates spatial datasets with them.

Different layers in one file can use different coordinate reference systems. Combining them for display or analysis may require coordinate transformation by the application.

The CRS information is essential to interpreting the data correctly. Identical numerical coordinates can refer to different places under different reference systems. A structurally valid GeoPackage can therefore still contain incorrectly positioned data if its CRS has been assigned incorrectly.

Spatial indexing and querying

For large feature tables, checking every geometry for every spatial query can be expensive. GeoPackage defines an optional spatial-index extension based on SQLite’s R-tree capability.

An R-tree indexes bounding rectangles, allowing an application to identify candidate features whose extents overlap a query region. This accelerates operations such as selecting features visible in a map window.

Bounding-box overlap is not the same as exact geometric intersection. Candidate features may still require a precise geometry test, especially for irregular shapes or polygons with holes.

GeoPackage standardizes storage and selected extension behavior; it does not require every reader to provide a comprehensive spatial SQL engine. Functions for buffering, intersection, reprojection, and other analysis depend on the software accessing the file.

Extensions and interoperability

GeoPackage’s extension mechanism allows capabilities to be added without redefining the entire format. Extension registrations identify the extension, its definition, its applicable tables or columns, and its scope.

This mechanism supports both standardized and application-specific additions, but it creates an important distinction between file readability and full interoperability. An application may read basic features while being unable to interpret an extension used elsewhere in the same package.

Unknown extensions are particularly significant during editing. Software that does not understand an extension may be unable to preserve its constraints or maintain associated structures correctly.

Likewise, successful opening is not proof of conformance. Validation can involve checking required tables, column definitions, geometry encodings, reference-system records, tile matrix consistency, and extension-specific rules.

Applications and software support

GeoPackage is used for data exchange, offline mapping, field data collection, and packaging related spatial layers into a single deliverable. A package can, for example, combine survey features, background imagery, and descriptive tables for use without an internet connection.

Widely used implementations include QGIS and GDAL, alongside commercial GIS products and mobile applications. Support varies by software version, content type, and extension.

Because GeoPackage uses SQLite, it benefits from database transactions and database-level integrity mechanisms. Applications can update records without rewriting the entire dataset, although the cost of changes still depends on indexing, file organization, and application behavior.

Limitations and comparison with other formats

Compared with an ESRI Shapefile, GeoPackage can hold multiple layers in one database and avoids several shapefile restrictions, including short attribute-field names and the dependence on companion files. Conversion is not necessarily lossless: differences in geometry support, field types, encodings, and application conventions still require attention.

Compared with a server-based spatial database, GeoPackage is simpler to distribute but less suited to intensive simultaneous editing by many users. SQLite permits concurrent readers but serializes writes; GeoPackage is not itself a multiuser database service.

The single-file model also requires qualification during active use. SQLite may create journal or write-ahead-log sidecar files. Copying only the main file while changes remain outside it can produce an incomplete copy, so consistent export or database backup mechanisms matter.

GeoPackage is not inherently optimized for selective remote access over the web. Although specialized software can enable remote workflows, serving many clients from a large package may be less suitable than using dedicated geospatial services or formats designed for range-based access.

Finally, packaging data together does not guarantee their accuracy, completeness, licensing compatibility, or consistent interpretation. The standard governs representation and exchange; data quality remains dependent on the source datasets and their preparation.