Class GridCoverage2DRIA
- All Implemented Interfaces:
RenderedImage,ImageImageN,PropertyChangeEmitter,PropertySource,WritablePropertySource
The exposed Layout will be the same as the target, and each Point in the target grid can be used in the resulting RenderedImage,
- Author:
- ETj <etj at geo-solutions.it>
-
Field Summary
Fields inherited from class GeometricOpImage
backgroundValues, computableBounds, extender, intBackgroundValues, interp, setBackgroundFields inherited from class OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecyclerFields inherited from class PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGridCoverage2DRIA(GridCoverage2D src, GridGeometry2D dst, Vector sources, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, Interpolation interp, double[] nodata, ROI roi, Hints hints) -
Method Summary
Modifier and TypeMethodDescriptionprotected RectanglebackwardMapRect(Rectangle destRect, int sourceIndex) Returns the minimum bounding box of the region of the specified source to which a particularRectangleof the destination will be mapped.protected voidcomputeRect(PlanarImage[] sources, WritableRaster dest, Rectangle destRect) Warps a rectangle.static GridCoverage2DRIAcreate(GridCoverage2D src, GridCoverage2D dst, double[] nodata) static GridCoverage2DRIAcreate(GridCoverage2D src, GridCoverage2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.static GridCoverage2DRIAcreate(GridCoverage2D src, GridGeometry2D dst, double[] nodata) Wrap the src coverage in the dst layout.static GridCoverage2DRIAcreate(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints) static GridCoverage2DRIAcreate(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.protected RectangleforwardMapRect(Rectangle pxRect, int sourceIndex) Returns the minimum bounding box of the region of the destination to which a particularRectangleof the specified source will be mapped.getTile(int tileX, int tileY) mapDestPoint(Point2D destPt, int sourceIndex) mapSourcePoint(Point2D srcPt, int sourceIndex) float[]warpRect(int x, int y, int width, int height, float[] destRect) float[]warpSparseRect(int x0, int y0, int width, int height, int periodX, int periodY, float[] destRect) Methods inherited from class GeometricOpImage
computeTile, getBorderExtender, getInterpolation, mapDestRect, mapSourceRectMethods inherited from class OpImage
addTileToCache, cancelTiles, computeRect, computesUniqueTiles, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorizeMethods inherited from class PlanarImage
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, getTileWidth, getWidth, overlapsMultipleTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
-
Constructor Details
-
GridCoverage2DRIA
protected GridCoverage2DRIA(GridCoverage2D src, GridGeometry2D dst, Vector sources, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, Interpolation interp, double[] nodata, ROI roi, Hints hints)
-
-
Method Details
-
create
Wrap the src coverage in the dst layout.
The resulting RenderedImage will contain the data in src, and will be accessible via the grid specs of dst,- Parameters:
src- the data coverage to be remapped on dst griddst- the provider of the final gridnodata- the nodata value to set for cells not covered by src but included in dst. All bands will share the same nodata value.- Returns:
- an instance of Coverage2RenderedImageAdapter
-
create
-
create
public static GridCoverage2DRIA create(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints) -
create
public static GridCoverage2DRIA create(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.
The resulting RenderedImage will contain the data in src, and will be accessible via the grid specs of dst,- Parameters:
src- the data coverage to be remapped on dst griddst- the provider of the final gridnodata- the nodata values to set for cells not covered by src but included in dst. All bands will use the related nodata value.hints- hints to use for the Rendering, Actually only ImageLayout is considered- Returns:
- an instance of Coverage2RenderedImageAdapter
-
create
public static GridCoverage2DRIA create(GridCoverage2D src, GridCoverage2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.
The resulting RenderedImage will contain the data in src, and will be accessible via the grid specs of dst,- Parameters:
src- the data coverage to be remapped on dst griddst- the provider of the final gridnodata- the nodata values to set for cells not covered by src but included in dst. All bands will use the related nodata value.- Returns:
- an instance of Coverage2RenderedImageAdapter
-
getTile
- Specified by:
getTilein interfaceRenderedImage- Overrides:
getTilein classOpImage
-
mapSourcePoint
- Overrides:
mapSourcePointin classGeometricOpImage
-
forwardMapRect
Returns the minimum bounding box of the region of the destination to which a particularRectangleof the specified source will be mapped.The integral source rectangle coordinates should be considered pixel indices. The "energy" of each pixel is defined to be concentrated in the continuous plane of pixels at an offset of (0.5, 0.5) from the index of the pixel. Forward mappings must take this (0.5, 0.5) pixel center into account. Thus given integral source pixel indices as input, the fractional destination location, as calculated by functions Xf(xSrc, ySrc), Yf(xSrc, ySrc), is given by:
xDst = Xf(xSrc+0.5, ySrc+0.5) - 0.5 yDst = Yf(xSrc+0.5, ySrc+0.5) - 0.5- Specified by:
forwardMapRectin classGeometricOpImage- Parameters:
pxRect- theRectanglein source coordinates.sourceIndex- the index of the source image.- Returns:
- a
Rectangleindicating the destination bounding box, ornullif the bounding box is unknown. - Throws:
IllegalArgumentException- ifsourceIndexis negative or greater than the index of the last source.IllegalArgumentException- ifsourceRectisnull.
-
mapDestPoint
- Overrides:
mapDestPointin classGeometricOpImage
-
backwardMapRect
Returns the minimum bounding box of the region of the specified source to which a particularRectangleof the destination will be mapped.The integral destination rectangle coordinates should be considered pixel indices. The "energy" of each pixel is defined to be concentrated in the continuous plane of pixels at an offset of (0.5, 0.5) from the index of the pixel. Backward mappings must take this (0.5, 0.5) pixel center into account. Thus given integral destination pixel indices as input, the fractional source location, as calculated by functions Xb(xDst, yDst), Yb(xDst, yDst), is given by:
xSrc = Xb(xDst+0.5, yDst+0.5) - 0.5 ySrc = Yb(xDst+0.5, yDst+0.5) - 0.5- Specified by:
backwardMapRectin classGeometricOpImage- Parameters:
destRect- theRectanglein destination coordinates.sourceIndex- the index of the source image.- Returns:
- a
Rectangleindicating the source bounding box, ornullif the bounding box is unknown. - Throws:
IllegalArgumentException- ifsourceIndexis negative or greater than the index of the last source.IllegalArgumentException- ifdestRectisnull.
-
computeRect
Warps a rectangle.Offers Improved performance with support for no data and region of interest.
- Overrides:
computeRectin classOpImage
-
warpRect
public float[] warpRect(int x, int y, int width, int height, float[] destRect) -
warpSparseRect
public float[] warpSparseRect(int x0, int y0, int width, int height, int periodX, int periodY, float[] destRect) - Parameters:
x0- The minimum X coordinate of the destination region.y0- The minimum Y coordinate of the destination region.width- The width of the destination region.height- The height of the destination region.periodX- The horizontal sampling period.periodY- The vertical sampling period.destRect- Afloatarray containing at least2*((width+periodX-1)/periodX)* ((height+periodY-1)/periodY)elements, ornull. Ifnull, a new array will be constructed.- Returns:
- A reference to the
destRectparameter if it is non-null, or a newfloatarray otherwise.
-
getSources
- Specified by:
getSourcesin interfaceRenderedImage- Overrides:
getSourcesin classPlanarImage
-