StaticcreateCreates a new GeoPackage database file on disk.
This method creates the file (and any missing parent directories), sets the
required GeoPackage application ID and user version, creates the mandatory
tables (gpkg_spatial_ref_sys, gpkg_contents, etc.), and inserts the
default Spatial Reference System definitions.
The absolute or relative file path where the new
GeoPackage should be created. The file extension should be .gpkg.
A GeoPackage instance connected to the newly created database.
StaticcreateCreates a new GeoPackage database entirely in memory.
The resulting database is not backed by any file on disk. It is useful for temporary workloads, testing, or building a GeoPackage that will later be serialized to a buffer or written to disk.
Like GeoPackageManager.create, this method initialises the required application ID, user version, mandatory tables, and default Spatial Reference System definitions.
A GeoPackage instance connected to an in-memory database.
StaticopenOpens an existing GeoPackage from a file path or an in-memory buffer.
When a file path is provided, the method verifies that the file exists and
has a valid GeoPackage extension (.gpkg or .gpkx) before opening it.
When a Buffer is provided, the GeoPackage is opened directly from memory.
The absolute or relative path to a .gpkg / .gpkx
file, or a Buffer containing the raw GeoPackage bytes.
A GeoPackage instance connected to the opened database.
StaticvalidateValidates whether a file on disk is a well-formed GeoPackage.
The validation checks include:
.gpkg or .gpkx.application_id matches the GeoPackage specification
(0x47504B47 for GPKG or 0x47503130 for GP10).gpkg_spatial_ref_sys table is present.gpkg_contents table is present.The absolute or relative path to the file to validate.
A ValidationResult object containing a valid boolean and
an errors array describing any issues found.
Factory class for creating, opening, and validating GeoPackage databases.
GeoPackageManagerprovides static methods to manage the lifecycle of GeoPackage instances. It supports opening existing GeoPackage files (from disk or in-memory buffers), creating new GeoPackage databases (on disk or in memory), and validating that a file conforms to the GeoPackage specification.Example