Class HMModelIM
- java.lang.Object
-
- org.hortonmachine.gears.libs.modules.HMModel
-
- org.hortonmachine.gears.libs.modules.HMModelIM
-
- Direct Known Subclasses:
OmsZonalStatsIM
public abstract class HMModelIM extends HMModel
-
-
Field Summary
Fields Modifier and Type Field Description protected List<org.locationtech.jts.geom.Geometry>boundsGeometriesprotected intcellBufferprotected org.opengis.referencing.crs.CoordinateReferenceSystemcrsprotected List<javax.media.jai.iterator.RandomIter>inRasterIteratorsprotected List<Double>inRasterNovaluesprotected List<org.geotools.coverage.grid.GridCoverage2D>inRastersprotected double[]llCornerprotected StringlocationFieldprotected List<org.geotools.coverage.grid.GridCoverage2D>outGridCoveragesprotected List<javax.media.jai.iterator.WritableRandomIter>outRasterIteratorsprotected org.geotools.coverage.grid.GridGeometry2DreadGridGeometryprotected double[]urCornerprotected doublexResprotected doubleyRes
-
Constructor Summary
Constructors Constructor Description HMModelIM()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddDestination(File outputFile)protected voidaddDestination(File outputFile, int position)protected voidaddSource(File imageMosaicSource)protected voiddispose()Disposes resources.protected org.geotools.coverage.grid.GridCoverage2DgetGridCoverage(int readerNum, double north, double south, double east, double west)Get theGridCoverage2Din a certain region.protected org.geotools.coverage.grid.GridCoverage2DgetGridCoverage(int readerNum, org.locationtech.jts.geom.Envelope envelope)protected voidmakeMosaic()protected voidmakeStyle(EColorTables colorTable, double min, double max)protected voidprocessByTileCells()protected abstract voidprocessCell(int readCol, int readRow, int writeCol, int writeRow, int readCols, int readRows, int writeCols, int writeRows)Process one cell.-
Methods inherited from class org.hortonmachine.gears.libs.modules.HMModel
checkCancel, checkFileExists, checkNull, checkWorkingFolderInPath, concatOr, dumpRaster, dumpVector, getDefaultThreadsNum, getRaster, getVector, help, isCanceled, template
-
-
-
-
Field Detail
-
inRasterIterators
protected List<javax.media.jai.iterator.RandomIter> inRasterIterators
-
inRasters
protected List<org.geotools.coverage.grid.GridCoverage2D> inRasters
-
outRasterIterators
protected List<javax.media.jai.iterator.WritableRandomIter> outRasterIterators
-
outGridCoverages
protected List<org.geotools.coverage.grid.GridCoverage2D> outGridCoverages
-
locationField
protected String locationField
-
xRes
protected double xRes
-
yRes
protected double yRes
-
crs
protected org.opengis.referencing.crs.CoordinateReferenceSystem crs
-
llCorner
protected double[] llCorner
-
urCorner
protected double[] urCorner
-
boundsGeometries
protected List<org.locationtech.jts.geom.Geometry> boundsGeometries
-
cellBuffer
protected int cellBuffer
-
readGridGeometry
protected org.geotools.coverage.grid.GridGeometry2D readGridGeometry
-
-
Method Detail
-
addDestination
protected void addDestination(File outputFile) throws IOException
- Throws:
IOException
-
addDestination
protected void addDestination(File outputFile, int position) throws IOException
- Throws:
IOException
-
getGridCoverage
protected org.geotools.coverage.grid.GridCoverage2D getGridCoverage(int readerNum, double north, double south, double east, double west) throws ExceptionGet theGridCoverage2Din a certain region.It might be usefull for faster access to the underlying data to extract the raster before creatin the iterator, instead of iterating directly.
This can be done on the returned gridcoverage through:
Raster readRaster = readGC.getRenderedImage().getData(); RandomIter readIter = RandomIterFactory.create(readRaster, null);- Parameters:
readerNum- the number of the reader to use.north-south-east-west-- Returns:
- the gridcoverage inside the supplied bounds.
- Throws:
Exception
-
getGridCoverage
protected org.geotools.coverage.grid.GridCoverage2D getGridCoverage(int readerNum, org.locationtech.jts.geom.Envelope envelope) throws Exception- Throws:
Exception
-
makeStyle
protected void makeStyle(EColorTables colorTable, double min, double max) throws Exception
- Throws:
Exception
-
dispose
protected void dispose()
Disposes resources.
-
processCell
protected abstract void processCell(int readCol, int readRow, int writeCol, int writeRow, int readCols, int readRows, int writeCols, int writeRows)Process one cell.This is used when
processByTileCells()is called.- Parameters:
readCol- the column of the cell to read.readRow- the row of the cell to read.writeCol- the column of the cell to write.writeRow- the row of the cell to write.readCols- the total columns of the current handled read tile.readRows- the total rows of the current handled read tile.writeCols- the total columns of the current handled written tile.writeRows- the total rows of the current handled written tile.
-
-