How to use the geoblaze.rasterCalculator 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 / raster-calculator / raster-calculator.container.js View on Github external
runRasterCalculator: (raster, rasterCalculator) => {
    if (!raster) return dispatch(showAlert('Please add a raster before running this tool.'));
    if (!rasterCalculator) return dispatch(showAlert('Please add a raster calculator operation before running this tool.'));
    try {
      dispatch(startLoading('Running Raster Calculator'));
      return geoblaze.rasterCalculator(raster, rasterCalculator).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`));
    }
  }
});