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 Summary
Constructors Constructor Description RasterizeAlgorithm(org.locationtech.jts.geom.Envelope limitEnvelope, FeatureCollection fCollection, String attributeName, double CellSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.EnvelopegetEnvelope()gets Raster org.locationtech.jts.geom.Envelope, recalculated according to the cell sizeWritableRastergetRaster()Gets java.awt.image.WritableRastervoidprocess()process a feature collection to create a raster according to a numeric attribute, a limit envelope and a cell size.voidsaveToFile(File file)Method to save results to a TIFF file
-
-
-
Constructor Detail
-
RasterizeAlgorithm
public RasterizeAlgorithm(org.locationtech.jts.geom.Envelope limitEnvelope, FeatureCollection fCollection, String attributeName, double CellSize) throws OutOfMemoryError, Exception- Throws:
OutOfMemoryErrorException
-
-
Method Detail
-
process
public void process() throws OutOfMemoryError, Exceptionprocess 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:
OutOfMemoryErrorException
-
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
-
-