Class RasterizeAlgorithm
java.lang.Object
org.openjump.core.rasterimage.algorithms.RasterizeAlgorithm
- 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
ConstructorsConstructorDescriptionRasterizeAlgorithm(org.locationtech.jts.geom.Envelope limitEnvelope, FeatureCollection fCollection, String attributeName, double CellSize) -
Method Summary
Modifier and TypeMethodDescriptionorg.locationtech.jts.geom.Envelopegets Raster org.locationtech.jts.geom.Envelope, recalculated according to the cell sizeGets 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 Details
-
RasterizeAlgorithm
public RasterizeAlgorithm(org.locationtech.jts.geom.Envelope limitEnvelope, FeatureCollection fCollection, String attributeName, double CellSize) throws OutOfMemoryError, Exception - Throws:
OutOfMemoryErrorException
-
-
Method Details
-
process
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:
OutOfMemoryErrorException
-
saveToFile
Method to save results to a TIFF file- Parameters:
file- destination File- Throws:
IOException- if an IOException occurs
-
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
-