How to use the geoblaze.bandArithmetic function in geoblaze

To help you get started, we’ve selected a few geoblaze examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GeoTIFF / geotiff.io / src / components / tools / band-arithmetic / band-arithmetic.container.js View on Github external
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`));
    }
  }
});