gdalcompare.py
比较两张图片。
简介
gdalcompare.py [-sds] golden_file new_file
描述
这个 gdalcompare.py 脚本比较两个GDAL支持的数据集并报告差异。除了向标准输出报告差异之外,脚本还将返回其退出值中的差异计数。
检查图像像素和各种元数据。还有一个逐字节的比较,这将算作一个差异。因此,如果GDAL可见数据是相同的,那么差异计数1(二进制差异)应该被认为是可以接受的。
- -sds
如果传递了此标志,则脚本将比较作为数据集一部分的所有子数据集,否则将忽略子数据集。
- <golden_file>
被认为是正确的文件,称为黄金文件。
- <new_file>
正在与黄金文件进行比较的文件,称为新文件。
Note that the gdalcompare.py script (like all the other scripts) can also be called as a library from 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 (excluding the binary comparison). The gdalcompare.compare_sds() entry point can be used to compare subdatasets.