GDAL Raster Scale and Offset: Check Drone Data Values Before Delivery
Distinguish stored raster samples from scaled analytical values, inspect per-band metadata, and plan a controlled GDAL unscale export for drone deliverables.

Ask which value the recipient actually receives
Two applications can open the same drone raster and present different numbers because they do not necessarily expose the same level of interpretation. One may show stored integer samples while another applies band metadata before displaying analytical values. A color ramp can conceal that distinction. During a NiVO mapping or inspection handoff, ask the recipient which values its analysis reads and what units they represent. This tutorial addresses a documented linear scale-and-offset encoding. It does not infer temperatures from image colors or establish the output format, calibration or analytical capability of any particular NiVO payload.
Start with an unmodified accepted raster and identify its revision, producing software and intended use. Keep any required auxiliary files with it. A metadata inspection belongs in a working folder, and a conversion should create a clearly named derivative instead of replacing the original. Determine whether the product is an RGB image, elevation surface, classification or another numerical layer before selecting an operation. An attractive preview does not establish that every band carries a continuous physical quantity. Band meaning must come from the delivery documentation or producer, including any limitations on how its values may be interpreted.
Inspect scale, offset, units and validity together
GDAL defines the interpreted value using the stored sample multiplied by the band scale and then increased by its offset. Its raster-band API documentation also states that low-level RasterIO and ReadBlock operations do not perform that adjustment automatically. This matters when a custom reader is compared with a GIS display. In a constructed encoding example, a stored sample of 15000 with scale 0.01 and offset minus 100 corresponds to 50 in the declared units. Those numbers illustrate arithmetic only; no temperature, elevation or reflectance interpretation follows without an independently established band definition.
Inspect each relevant band rather than assuming the first band describes the whole dataset. Record the sample type, scale, offset, unit label, NoData declaration and any validity mask. Keep explicit metadata distinct from a reader fallback or a missing field. The command below is an inspection example for an identified local file. Review its output and the installed software version before planning a conversion. A missing unit label is an unresolved documentation question, not an invitation to choose a familiar unit. Equally, a valid stored zero should not disappear simply because another workflow commonly uses zero for a background.
# Inspect an identified local source; keep the original unchanged.
gdalinfo --version
gdalinfo -json accepted-raster.tif
# Review each band's type, scale, offset, unit and validity metadata.
Product context only; this photograph does not depict the constructed examples in this article.
Distinguish assigning metadata from applying it
The gdal_translate documentation distinguishes assigning band scale or offset from changing stored pixels. Its -a_scale and -a_offset options attach metadata; they do not themselves transform sample values. The separate -unscale operation applies existing band metadata, and GDAL notes that a suitable output data type is often needed. Do not combine newly assigned coefficients and -unscale in one command expecting those new assignments to drive the calculation: the documented operation does not use them that way. This distinction is central to a reproducible delivery because both files may open normally while representing different stages of interpretation.
Before writing an export command, describe the desired derivative in plain language. For example, the recipient may require floating-point samples already expressed in documented analytical units, with no additional coefficient application expected downstream. Another recipient may accept the original compact encoding and its metadata. Choose one agreement and record it with the delivery. Changing a metadata label cannot establish a missing calibration relationship, and applying a linear transform cannot recover information that the source never contained. If the coefficients or units are uncertain, preserve the input and ask the producer to resolve the encoding rather than guessing from plausible-looking statistics.
Plan a separate floating-point derivative
Once the source metadata is verified and the delivery requires applied values, the following command illustrates a separate Float32 derivative. It assumes the source already contains the accepted scale and offset. Choose an unused output filename, confirm that the available data type provides the precision the project needs, and inspect the result before acceptance. The example is documentation-based command guidance, not a report of a completed conversion. It does not resample a project, establish a coordinate reference system or validate a sensor model. Keep those questions separate from the value-encoding operation and retain the full processing command.
GDAL also provides the newer gdal raster unscale interface, introduced in version 3.11. Its documentation states that bands without scale or offset metadata retain their values, and describes the default output type choices. This is a useful reminder to check the actual installed interface and every selected band instead of assuming all inputs undergo the same numerical change. Select one supported interface for the project and record it. There is no need to run two alternatives on the same accepted data just because both exist; a single traceable operation with a verified output is easier for a recipient to review.
# Only after verifying scale/offset already stored in the source:
gdal_translate -of GTiff -ot Float32 -unscale accepted-raster.tif applied-values.tif
gdalinfo -json applied-values.tif
# Inspect output samples, units, masks and remaining scale/offset metadata.Check samples, masks and double application
Build a small acceptance record using valid locations spanning the relevant numerical range and locations known to be invalid. For each valid location, retain its band, pixel position, stored source value, accepted coefficients, expected interpreted value and derivative value. This record tests the encoding agreement directly. Select a numerical comparison tolerance from the output representation and project requirement; do not describe decimal agreement as sensor accuracy. Keep invalid locations in a separate validity review so that a sentinel is never accidentally presented as a measurement simply because arithmetic produces a finite result.
Open the derivative in the receiving application and query those same locations. Confirm whether the application applies any remaining scale or offset metadata and whether the derivative would therefore be transformed a second time. Check dimensions, spatial reference and validity behavior as part of the handoff, and explain any intentional changes. A plausible minimum and maximum alone are weak evidence: incorrect coefficients can still create plausible ranges. Likewise, a matching screenshot does not prove matching analytical values. The acceptance record should let a second analyst trace a specific queried number back to its source sample and documented interpretation.
Package the value interpretation with the raster
Deliver the original identity, derivative identity, producing command, software version, per-band meaning, coefficient status and unit definition together. State whether stored samples still require a transform or already contain the agreed interpreted values. Include the small acceptance record and the expected treatment of NoData and masks. If downstream calculations mix bands or datasets, identify the interpretation required for each input before they are combined. A file called final-values is not a sufficient contract. The recipient should be able to answer the value question without recovering assumptions from an old chat or reverse-engineering the map legend.
For NiVO survey planning and payload discussions, this workflow helps distinguish a storage convention from evidence about a real measurement system. A scale factor can explain how a delivered raster encodes numbers; it does not by itself establish radiometric calibration, vertical accuracy, surface temperature or interoperability with every analysis package. Keep such claims tied to the actual sensor documentation and tested processing chain. When the band meaning remains uncertain, document that limitation and retain the source. A clear value-interpretation record makes the technical review actionable while preserving the boundary between an illustrative encoding example and a demonstrated project result.



