GDALCOMPARE(1)
π GDALCOMPARE π
okay so bestie, buckle up β this is gdalcompare, a.k.a. the GDAL man page from the GDAL manual fam, and honestly? she's a vibe. she compares two images and tells you every single thing that's different about them. lowkey iconic.
β¨ NAME β¨
gdalcompare β compare two images. that's it. that's the whole job. π
πΈ SYNOPSIS πΈ
gdalcompare.py [-sds] golden_file new_file
π¦ DESCRIPTION π¦
so the gdalcompare.py script takes two datasets that GDAL can handle and reports the differences between them. and not just, like, quietly β she reports differences to standard output and she returns the difference count in her exit value. double whammy. π
what actually gets checked? image pixels, for one. and various metadata too. and on top of all that there's a byte-by-byte comparison happening, which counts as one difference. so like β heads up β if the only thing you actually care about is that the GDAL-visible data is identical, then a difference count of 1 (that's the binary difference right there) should be considered acceptable. no cap. β¨
-sdsβ if you pass this flag, the script will compare all the subdatasets that are part of the dataset. if you don't pass it, subdatasets are just ignored. simple as that. π- <golden_file> β the file that's considered correct, a.k.a. the golden file. she's the reference, she's the moment, she's the standard. π
- <new_file> β the file being compared against the golden file, a.k.a. the new file. she's the one under the microscope π₯
ngl one thing you should know: the gdalcompare.py script (like literally all the other scripts, fr fr) can also be called as a library straight from your python code:
from osgeo_utils import gdalcompare
the primary entry point is gdalcompare.compare(), which takes a golden gdal.Dataset and a new gdal.Dataset as arguments and returns a difference count β and yes, that's excluding the binary comparison, just so we're clear π
. and if you're doing the subdataset thing, the gdalcompare.compare_sds() entry point is right there for comparing subdatasets. π«Ά
π AUTHOR π
Frank Warmerdam <warmerdam@pobox.com> β the author herself. respect the icon. π
π COPYRIGHT π
1998-2026 β yeah, she's been serving for a minute. β
and that's the tea, bestie π β this page is from the GDAL manual, dated Jan 08, 2026, and it lives at GDALCOMPARE(1). go forth and diff. π§π
π¦ where this page comes from
- epel 9: gdal3.4 3.4.3-5.el9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms