NiVO / BY TECHNOGISGermany · Indonesia
Geospatial

Make a Consistent GeoPackage Handoff When WAL Files Are Present

A practical release workflow for drone mapping GeoPackages: account for committed WAL content, create a SQLite-aware snapshot, and verify the moved delivery in the receiving GIS.

Make a Consistent GeoPackage Handoff When WAL Files Are Present

Ask what state the delivered filename represents

A survey analyst adds the last inspection finding to a GeoPackage, sees it in the GIS and copies the .gpkg file into a delivery folder. The recipient opens that copy and cannot find the new record. One possible explanation is a packaging mistake involving SQLite write-ahead logging, usually called WAL. A committed change can reside in the associated log before it is transferred into the main database file. Therefore seeing the record in a working application does not establish that copying the main filename alone captures the same committed state. Establish the release state before choosing a copying method.

This tutorial concerns a controlled handoff of a drone mapping database, not recovery of an unknown damaged file. The example filenames and record identities are illustrative and do not describe a NiVO client dataset. Preserve the working package and use an approved release process with its owner. Finish edits and coordinate application access before producing a snapshot. A technically readable SQLite copy is not automatically a conformant GeoPackage, and neither property establishes that its geometries or survey interpretations are correct. The checks below keep those different acceptance questions visible.

Keep the received database environment together

Inventory the working database and any same-name -wal and -shm files before separating or moving anything. Record the application, its embedded SQLite version and the intended release revision. The WAL is part of persistent database state while it contains relevant transactions; the shared-memory file supports coordination and indexing rather than serving as an independent replacement database. Do not tidy the folder by deleting companion files manually. If the package was received from someone else and its state is uncertain, preserve the entire received set and ask for a controlled release or a documented recovery assessment.

Use a maintained software build with the applicable SQLite fixes, and distinguish the library inside the GIS from an unrelated command-line installation. Arrange a period with no further operational edits so the release has a clear identity. Close writing applications cleanly where the project procedure permits it. If access cannot be coordinated, use the application’s supported consistent export or backup process and document the resulting snapshot boundary. Arbitrarily copying changing files one after another is not the same operation as asking SQLite to create a consistent database snapshot.

Restored NiVO VTOL V3 product image from the supplied brochure
Restored NiVO VTOL V3 product image from the supplied brochure.Source: NiVO / TechnoGIS catalogue materials supplied by the site owner · Catalogue photo
Product context only; this photograph does not depict the constructed examples in this article.

Create a new snapshot with a SQLite-aware method

For an approved local working database, the SQLite shell offers a .backup command based on its database-aware backup facilities. The example below opens working-survey.gpkg read-only and writes a new delivery-survey.gpkg. Confirm that the destination name is unused and that the source file exists before running it. Keep any source companions in place. Record the command and its actual diagnostics, then close the shell connection. If access fails or the source is busy, resolve the release coordination or supported access method instead of deleting a log, bypassing a lock or forcing an incomplete copy.

Read-only access is not a repair switch and does not make an incomplete received set complete. WAL-mode read access has documented requirements involving the relevant files and environment. Follow the application and SQLite documentation for the installation actually being used. This example intentionally does not issue a checkpoint or change journaling mode on the working source. If a project requires a particular delivery journal mode, let the approved exporter or responsible database specialist create that release and verify it. A source-mode change should not be improvised simply to make the folder contain fewer filenames.

sqlite3 -version
sqlite3 -readonly working-survey.gpkg ".backup delivery-survey.gpkg"

Check database structure and geospatial content separately

Inspect the newly created snapshot with read-only queries before loading it into the receiving GIS. The commands below query the journal mode and run SQLite integrity and foreign-key checks. Read every returned row and any error text. SQLite documents that integrity_check returns ok when it finds no errors, but it does not cover foreign-key errors; the separate foreign_key_check addresses that question. These checks do not inspect whether a survey boundary was drawn correctly, whether the intended CRS was assigned, or whether a finding classification is justified. An ok response is a bounded database result.

Then inspect the GeoPackage-specific layer catalogue, geometry types, reference definitions, attribute schema and declared extensions using suitable geospatial tooling. Confirm representative stable identifiers and the last accepted edits against the release record. Include nulls, date fields and relationships that the recipient will actually use. The OGC standard defines more than a SQLite filename or header, so an arbitrary SQLite database renamed with a .gpkg suffix is not an acceptable substitute. Keep the container checks and geospatial acceptance evidence with their respective tools and versions, rather than compressing them into one unexplained validation label.

sqlite3 -readonly delivery-survey.gpkg "PRAGMA journal_mode;"
sqlite3 -readonly delivery-survey.gpkg "PRAGMA integrity_check;"
sqlite3 -readonly delivery-survey.gpkg "PRAGMA foreign_key_check;"

Test a moved release without the working folder

Copy the accepted release package into a clean approved test directory and open it with the actual receiving application. Ensure that the application reads that moved copy, not a cached connection or a similarly named working layer. Retrieve the known last-edited feature by its stable project identifier and compare its accepted attributes and geometry. Check the expected layer counts and representative records. Also test external photographs, styles and related project files when those belong to the agreed delivery. A consistent database snapshot cannot automatically repair an external link that points into the author’s personal working directory.

Challenge the verification with a disposable copy of an earlier accepted revision. The reviewer should notice that the designated last edit or release identity is absent rather than accepting any file that opens without an error. This negative comparison tests whether the release check actually discriminates between revisions. Restore the intended release before delivery. If the moved copy disagrees with the working view, retain both records and investigate the snapshot boundary, file identity and application behavior. Do not overwrite the evidence until the difference is understood and a corrected release has been independently checked.

Release the snapshot and its acceptance record

Deliver the approved GeoPackage revision, its final file hash, layer inventory, data dictionary and checked receiving-application version. Identify any accompanying media or project files and distinguish them from temporary working artifacts. State whether the release is intended for read-only review or later editing, and provide the relevant supported workflow. Preserve the source package and the snapshot creation record privately so a later query can be traced to an accepted revision. Avoid describing a clean folder as proof of correctness: the decisive evidence is the reproduced release state and the documented content checks.

For later updates, produce a new identified snapshot rather than replacing the file behind an old report without explanation. Repeat the last-edit retrieval and moved-copy test after changes to the exporter or receiving software. This modest discipline is valuable for NiVO mapping and inspection handoffs because it makes a storage-state issue distinguishable from a missing survey observation or an interpretation error. The final statement can then be specific: the delivered revision was created consistently, checked at the database and GeoPackage levels, and reopened with the agreed content in the receiving workflow.

Technical references

  1. SQLite WAL: committed log state and database companion files ↗
  2. SQLite backup facilities and consistent snapshots ↗
  3. SQLite shell: .backup and read-only access ↗
  4. SQLite integrity_check and foreign_key_check pragmas ↗
  5. OGC GeoPackage 1.4 encoding standard ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team