in scripts/layerdiff.js [170:209]
const reportDiffs = function ({ id, left, right, diffs, details }) {
const numErrors = compact(values(diffs)).length;
if (numErrors === 0 && !VERBOSE) {
print(`Feature ${id} is OK ✔️`);
return;
} else {
print(`\n---------------------------------- Feature ${id}`);
}
if (diffs.properties) {
print('❌ Properties differ:');
console.table({ left: left.properties, right: right.properties });
} else if (VERBOSE) {
print('✔️ Properties are OK');
console.table([left.properties]);
}
if (diffs.area || VERBOSE) {
const mark = diffs.area ? '❌' : '✔️';
print(`${mark} Area difference: `, details.area.toFixed(2) + '%');
if (VERBOSE > 0) {
console.table(details.areas);
}
}
if (diffs.centroid || VERBOSE) {
const mark = diffs.centroid ? '❌' : '✔️';
print(`${mark} Centroid distance:`, Math.round(details.centroid) + 'm');
if (VERBOSE > 0) {
console.table(details.centroids);
}
}
if (diffs.parts || VERBOSE) {
const mark = diffs.parts ? '❌' : '✔️';
print(`${mark} Geometry parts: left: ${details.parts.left} right: ${details.parts.right}`);
}
};