NiVO / BY TECHNOGISGermany · Indonesia
Geospatial

Restore Compact RINEX Before a Drone PPK Import

A practical tutorial for separating archive compression from Hatanaka restoration, preserving GNSS originals, and checking the restored observation file before a drone PPK workflow.

Restore Compact RINEX Before a Drone PPK Import

Recognize two different transformations of the file

A drone PPK processor receives a reference observation file ending in .crx.gz. An archive utility removes the gzip layer, leaving a smaller-looking text file that the GNSS application still rejects. That does not necessarily mean the observation recording is damaged. The remaining file may be Compact RINEX, which needs restoration of its observation representation before a reader expecting ordinary RINEX can use it. Treat archive decompression and Hatanaka restoration as separate questions. The filename is a useful clue, but the actual content and the receiving software’s documented capabilities determine the next step.

GSI’s RNXCMP software compresses and restores RINEX observation data through the Compact RINEX representation. This tutorial uses that distinction to build a controlled import preparation workflow. It does not convert an arbitrary receiver binary, generate missing observations or demonstrate the accuracy of a NiVO PPK solution. The filenames in the example are teaching names, not supplied datasets or records of an actual survey. Practice with an approved small observation file, keep the received original unchanged, and record the transformations before a restored file enters operational processing.

Preserve the received bytes and identify their role

Create an intake record with the provider, station or receiver identity, observation interval, stated format and received filename. Store a cryptographic hash of the original bytes before working on a copy. Keep the provider’s accompanying information with the intake record. An observation file, navigation file and proprietary receiver log serve different roles, even if all appear in the same delivery folder. Ask the provider to resolve an ambiguous role instead of choosing a converter solely because it recognizes part of the extension. Renaming a file does not change its representation or make it a suitable input.

Separate the untouched intake folder from a restoration workspace and an accepted-output folder. Record the converter implementation and version, including any wrapper around RNXCMP. The Python hatanaka package is one documented interface that handles Hatanaka and supported outer compression formats. Its maintainer documents exceptions and warnings, so retain those messages instead of treating a created output file as automatic success. Use an approved installation and review its included software terms. Do not install an unrelated converter from an unknown download site merely because its filename resembles the observation format.

NiVO VTOL V7 with a white fuselage, lift rotors, and yellow wing tips
NiVO VTOL V7 with a white fuselage, lift rotors, and yellow wing tips.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.

Restore a small working copy without overwriting it

The following Python example reads a teaching input named example-base.crx.gz and writes an ordinary observation representation to a new filename. The destination is opened exclusively, so an existing result is not silently replaced. The two hashes identify different stages of the file chain; they are not expected to match because the representations differ. Save the script, package version and actual console output with the working record. The first restored header line is displayed for inspection, but that display alone is not a complete RINEX validation or a successful PPK import.

This compact example holds the input and restored bytes in memory, so use it first on an appropriately small accepted test file. For large operational files, use a reviewed conversion method suitable for their size and retain the same provenance checks. If restoration reports an error or a warning, preserve the original and the diagnostic message, then investigate format support and file completeness. Avoid repeatedly changing extensions or deleting headers to make the reader accept the file. Those actions can hide the actual failure while creating an output whose relationship to the original is difficult to establish.

from pathlib import Path
from hashlib import sha256
import hatanaka

received = Path("example-base.crx.gz")
destination = Path("example-base-restored.rnx")
original = received.read_bytes()
restored = hatanaka.decompress(original)

with destination.open("xb") as output:
    output.write(restored)

print("received SHA256:", sha256(original).hexdigest())
print("restored SHA256:", sha256(restored).hexdigest())
print(restored.splitlines()[0].decode("ascii"))

Inspect the restored observations rather than the suffix

Open the restored file with a suitable RINEX inspection tool and reconcile its header with the intake record. Check the declared version and observation role, station identity, receiver and antenna information, and time convention. Then inspect actual observation epochs and signal types relevant to the intended PPK method. A readable header does not establish that the body covers the required interval. Compare the restored content with the provider’s stated session and with the rover’s required time coverage. Keep discrepancies explicit so the processor knows whether the issue concerns packaging, recording availability or metadata interpretation.

Restoration should not be used as an excuse to normalize uncertain station metadata silently. If an antenna entry or reference coordinate appears wrong, preserve the restored file as a conversion result and record any later correction as a separate reviewed step. Link that correction to field or provider evidence. Similarly, the existence of observations from several constellations does not prove that the processing software supports all recorded signals. Test the accepted file through the intended importer on a copy and retain unsupported-field or observation warnings alongside the import result.

Design a comparison that can reveal a restoration defect

When an ordinary RINEX original is available from the provider, compare its observation content with the restored result using a reader that understands the declared version. Keep text-layout differences separate from changes in epochs, satellites, observation values or relevant indicators. If the workflow offers a documented compression-and-restoration check, run it on a disposable accepted sample and inspect the result. Do not assume that every wrapper produces byte-identical metadata formatting. Define what the comparison is intended to preserve and retain any exceptions rather than announcing success from equal file sizes.

Challenge the intake process with a clearly incomplete disposable copy, keeping the original untouched. Confirm that the inspection or import review notices the truncation or missing observation interval. This is a check of the review method, not a technique for repairing a damaged recording. Never fill a missing observation period with invented values to make a session look continuous. If the provider can supply a replacement, retain both intake identities and explain which one was accepted. If not, hand the limitation to the responsible processor before downstream position quality is assessed.

Hand over a traceable observation chain

Deliver the original received file, restored accepted file, converter identity, input and output hashes, diagnostic messages and inspection summary. State which observations were actually imported and which questions remain unresolved. Keep the navigation and other supporting inputs identified separately. A colleague should be able to repeat the preparation without guessing whether an archive utility, Hatanaka converter or receiver-binary exporter was used. The chain also makes later support more focused: an importer complaint can be traced to a specific representation and tool version rather than an unexplained collection of similarly named files.

Finally keep preparation acceptance separate from the PPK solution review. Correctly restored RINEX can still describe an unsuitable reference setup, insufficient overlap or observations that do not support the required result. Those questions belong in the processing and survey evidence, not in the hash record. The useful outcome of this tutorial is narrower and reproducible: the received observation representation was identified, restored with a documented tool, checked against its stated content and handed to the intended importer without losing the original evidence or inventing data that were never recorded.

Technical references

  1. GSI RNXCMP: Compact RINEX observation compression and restoration ↗
  2. GSI RNXCMP package README and documentation requirements ↗
  3. Hatanaka Python interface: decompression, supported wrappers and diagnostics ↗
  4. Python pathlib: binary reads and explicit file-open modes ↗
  5. Python hashlib: SHA-256 byte digests ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team