Class RasterizeAlgorithm

java.lang.Object
org.openjump.core.rasterimage.algorithms.RasterizeAlgorithm

public class RasterizeAlgorithm extends Object
Author:
Giuseppe Aruta a class to port two methods to rasterize a FeatureCollection - from Sextante (https://joinup.ec.europa.eu/solution/sextante/about) - from AdbToolbox (http://www.pcn.minambiente.it/mattm/adb-toolbox/)
  • Constructor Details

  • Method Details

    • process

      public void process() throws OutOfMemoryError, Exception
      process a feature collection to create a raster according to a numeric attribute, a limit envelope and a cell size. Feature are first chosen according if they overlap the limit envelope. Then they are merged according the chosen attribute, then converted to a grid Methods saveToFile(File) and getRaster() and getEnvelope() allows to save to file or to get raster and envelope for further manipulations
      Throws:
      OutOfMemoryError
      Exception
    • saveToFile

      public void saveToFile(File file) throws IOException
      Method to save results to a TIFF file
      Parameters:
      file - destination File
      Throws:
      IOException - if an IOException occurs
    • getRaster

      public WritableRaster getRaster()
      Gets java.awt.image.WritableRaster
      Returns:
      java.awt.image.WritableRaster
    • getEnvelope

      public org.locationtech.jts.geom.Envelope getEnvelope()
      gets Raster org.locationtech.jts.geom.Envelope, recalculated according to the cell size
      Returns:
      org.locationtech.jts.geom.Envelope