Compare-GeoJSON
Compare functions take as inputs the following:
oldVersion
- GeoJSON of the feature's old versionnewVersion
- GeoJSON of the feature's new versioncallback
- A function to call after processing.
Compare functions output the following:
error
- Error if any during processing or null
.result
- Object containing key value pairs representing findings of the compare function or an empty object.
A sample compare function would look something like this:
function checkPlaceRemoval(newVersion, oldVersion, callback) {
var oldProps = oldVersion.properties;
var newProps = newVersion.properties;
var result = {};
if (oldProps.hasOwnProperty('place') && !newProps.hasOwnProperty('place')) {
result['result:place_removed'] = true;
}
return callback(null, result);
}