Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
runBandArithmetic: (raster, bandArithmetic) => {
if (!raster) return dispatch(showAlert('Please add a raster before running this tool.'));
if (!bandArithmetic) return dispatch(showAlert('Please add an arithmetic operation before running this tool.'));
try {
dispatch(startLoading('Running Band Arithmetic'));
return geoblaze.bandArithmetic(raster, bandArithmetic).then(newRaster => {
dispatch(stopLoading());
dispatch(addRasterFromGeoraster(newRaster));
});
} catch(e) {
dispatch(stopLoading());
dispatch(showAlert(`${SITE_CONFIG.title} was unable to complete the operation. Please make sure you are using a multi-band raster and a valid arithmetic operation`));
}
}
});