org.gvsig.raster.algorithm.process
Class ProcessUtils

java.lang.Object
  extended by org.gvsig.raster.algorithm.process.ProcessUtils
Direct Known Subclasses:
ProcessParamsManagement

public abstract class ProcessUtils
extends java.lang.Object

Clase base de todos los procesos raster. En ella se genstionan todas las funciones comunes como incremento de la tarea, gestión de eventos a la tarea, parámetros de la tarea, etc ...

Author:
Nacho Brodin nachobrodin@gmail.com

Field Summary
protected  org.gvsig.fmap.dal.coverage.datastruct.NoData doubleNODATA
           
 
Constructor Summary
ProcessUtils()
           
 
Method Summary
 org.gvsig.fmap.dal.coverage.dataset.Buffer createOutputBuffer(int w, int h, int bandCount)
          Builds the output buffer
 org.gvsig.fmap.dal.coverage.dataset.Buffer createOutputBuffer(int w, int h, int bandCount, int datatype)
           
 org.gvsig.fmap.dal.coverage.dataset.Buffer createSourceBuffer(org.gvsig.fmap.dal.coverage.store.RasterDataStore store, java.awt.geom.Rectangle2D sourcePxBBox, boolean[] bands)
          Gets a data buffer from a RasterDataStore
 void debug(java.lang.String msg, java.lang.Object parent, java.lang.Exception exception)
          Registra un mensaje de error en el log de gvSIG
 boolean exportRaster(java.lang.String sFilename, org.gvsig.fmap.dal.coverage.dataset.Buffer buf, org.gvsig.fmap.dal.coverage.dataset.Buffer alphaBuffer, double cellsize, double ulx, double uly)
          Exports a raster buffer to disk
 void exportRaster(java.lang.String sFilename, org.gvsig.fmap.dal.coverage.dataset.Buffer buf, org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation ci, org.gvsig.fmap.dal.coverage.datastruct.Extent windowExtent, org.gvsig.fmap.dal.coverage.datastruct.NoData nodata, org.cresques.cts.IProjection proj)
          Exports a raster buffer to disk
 boolean exportRaster(java.lang.String sFilename, org.gvsig.fmap.dal.coverage.dataset.Buffer buf, double cellsize, double ulx, double uly)
          Exports a raster buffer to disk
 boolean exportRaster(java.lang.String sFilename, org.gvsig.fmap.dal.coverage.dataset.Buffer buf, double cellsize, double minX, double minY, org.gvsig.fmap.dal.coverage.datastruct.NoData nodata)
          Exports a raster buffer to disk
protected  double getData(org.gvsig.fmap.dal.coverage.dataset.Buffer b, int row, int col, int band)
          Gets a value of the buffer in double format
 org.gvsig.fmap.dal.coverage.datastruct.Extent getExtentResult(org.gvsig.fmap.dal.coverage.datastruct.Extent window, java.util.List<org.gvsig.raster.roi.ROI> rois, org.gvsig.fmap.dal.coverage.store.RasterDataStore store)
          Gets the bounding box taking into account whether there are ROIs or not
protected  java.awt.geom.Rectangle2D[] getIntersectionInPxCoords(org.gvsig.fmap.dal.coverage.store.RasterDataStore[] dataStoreList)
          Gets a list of rectangles which represents the pixel coordinates of each DataStore.
 java.awt.geom.Rectangle2D getSourcePxBox(org.gvsig.fmap.dal.coverage.datastruct.Extent resultExtent, org.gvsig.fmap.dal.coverage.store.RasterDataStore store)
          Gets the bounding box of the source in pixel coordinates
 boolean isAnalizedEntireLayer(org.gvsig.fmap.dal.coverage.datastruct.Extent window, java.util.List<org.gvsig.raster.roi.ROI> rois, org.gvsig.fmap.dal.coverage.store.RasterDataStore store)
          Returns true if the algorithm is applied to the entire layer
 boolean isInsideOfROI(int x, int y, java.util.List<org.gvsig.raster.roi.ROI> rois, org.gvsig.fmap.dal.coverage.datastruct.Extent extentResult)
          Checks if the point in pixel coordinates is inside the region of interest or not.
 void messageBoxError(java.lang.String msg, java.lang.Object parentWindow)
          Shows a error dialog with a text and a accept button
 void messageBoxError(java.lang.String msg, java.lang.Object parentWindow, java.util.ArrayList<java.lang.Exception> exception)
          Muestra un dialogo de error con un texto y un botón de aceptar.
 void messageBoxError(java.lang.String msg, java.lang.Object parentWindow, java.lang.Exception exception)
          Muestra un dialogo de error con un texto y un botón de aceptar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doubleNODATA

protected org.gvsig.fmap.dal.coverage.datastruct.NoData doubleNODATA
Constructor Detail

ProcessUtils

public ProcessUtils()
Method Detail

createOutputBuffer

public org.gvsig.fmap.dal.coverage.dataset.Buffer createOutputBuffer(int w,
                                                                     int h,
                                                                     int bandCount)
Builds the output buffer

Parameters:
sourcePxBBox -
bandCount -
Returns:

createOutputBuffer

public org.gvsig.fmap.dal.coverage.dataset.Buffer createOutputBuffer(int w,
                                                                     int h,
                                                                     int bandCount,
                                                                     int datatype)

createSourceBuffer

public org.gvsig.fmap.dal.coverage.dataset.Buffer createSourceBuffer(org.gvsig.fmap.dal.coverage.store.RasterDataStore store,
                                                                     java.awt.geom.Rectangle2D sourcePxBBox,
                                                                     boolean[] bands)
                                                              throws ProcessException
Gets a data buffer from a RasterDataStore

Throws:
ProcessException

debug

public void debug(java.lang.String msg,
                  java.lang.Object parent,
                  java.lang.Exception exception)
Registra un mensaje de error en el log de gvSIG

Parameters:
msg - Mensaje a guardar en el log
parent - Objeto que hizo disparar el mensaje
exception - Excepcion que ha sido recogida

exportRaster

public boolean exportRaster(java.lang.String sFilename,
                            org.gvsig.fmap.dal.coverage.dataset.Buffer buf,
                            org.gvsig.fmap.dal.coverage.dataset.Buffer alphaBuffer,
                            double cellsize,
                            double ulx,
                            double uly)
Exports a raster buffer to disk

Parameters:
sFilename -
buf -
cellsize -
minX -
minY -
Returns:

exportRaster

public void exportRaster(java.lang.String sFilename,
                         org.gvsig.fmap.dal.coverage.dataset.Buffer buf,
                         org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation ci,
                         org.gvsig.fmap.dal.coverage.datastruct.Extent windowExtent,
                         org.gvsig.fmap.dal.coverage.datastruct.NoData nodata,
                         org.cresques.cts.IProjection proj)
Exports a raster buffer to disk

Parameters:
sFilename -
buf -
cellsize -
minX -
minY -
Throws:
org.gvsig.fmap.dal.exception.ProviderNotRegisteredException
org.gvsig.fmap.dal.exception.InitializeException

exportRaster

public boolean exportRaster(java.lang.String sFilename,
                            org.gvsig.fmap.dal.coverage.dataset.Buffer buf,
                            double cellsize,
                            double ulx,
                            double uly)
Exports a raster buffer to disk

Parameters:
sFilename -
buf -
cellsize -
minX -
minY -
Returns:

exportRaster

public boolean exportRaster(java.lang.String sFilename,
                            org.gvsig.fmap.dal.coverage.dataset.Buffer buf,
                            double cellsize,
                            double minX,
                            double minY,
                            org.gvsig.fmap.dal.coverage.datastruct.NoData nodata)
Exports a raster buffer to disk

Parameters:
sFilename -
buf -
cellsize -
minX -
minY -
Returns:
Throws:
org.gvsig.fmap.dal.exception.ProviderNotRegisteredException
org.gvsig.fmap.dal.exception.InitializeException

getData

protected double getData(org.gvsig.fmap.dal.coverage.dataset.Buffer b,
                         int row,
                         int col,
                         int band)
Gets a value of the buffer in double format

Parameters:
b -
row -
col -
band -
Returns:

getExtentResult

public org.gvsig.fmap.dal.coverage.datastruct.Extent getExtentResult(org.gvsig.fmap.dal.coverage.datastruct.Extent window,
                                                                     java.util.List<org.gvsig.raster.roi.ROI> rois,
                                                                     org.gvsig.fmap.dal.coverage.store.RasterDataStore store)
Gets the bounding box taking into account whether there are ROIs or not

Returns:

getIntersectionInPxCoords

protected java.awt.geom.Rectangle2D[] getIntersectionInPxCoords(org.gvsig.fmap.dal.coverage.store.RasterDataStore[] dataStoreList)
Gets a list of rectangles which represents the pixel coordinates of each DataStore. This rectangle is the area that intersects with the other DataStores in the list.

Parameters:
dataStoreList -
Returns:

getSourcePxBox

public java.awt.geom.Rectangle2D getSourcePxBox(org.gvsig.fmap.dal.coverage.datastruct.Extent resultExtent,
                                                org.gvsig.fmap.dal.coverage.store.RasterDataStore store)
Gets the bounding box of the source in pixel coordinates

Parameters:
resultExtent -
Returns:

isAnalizedEntireLayer

public boolean isAnalizedEntireLayer(org.gvsig.fmap.dal.coverage.datastruct.Extent window,
                                     java.util.List<org.gvsig.raster.roi.ROI> rois,
                                     org.gvsig.fmap.dal.coverage.store.RasterDataStore store)
Returns true if the algorithm is applied to the entire layer

Parameters:
extent -
rois -
store -
Returns:

isInsideOfROI

public boolean isInsideOfROI(int x,
                             int y,
                             java.util.List<org.gvsig.raster.roi.ROI> rois,
                             org.gvsig.fmap.dal.coverage.datastruct.Extent extentResult)
Checks if the point in pixel coordinates is inside the region of interest or not. The point will be

Parameters:
x -
y -
rois -
extentResult - Bounding box of the area to which belongs the point defined in pixel coordinates (x, y)
Returns:

messageBoxError

public void messageBoxError(java.lang.String msg,
                            java.lang.Object parentWindow)
Shows a error dialog with a text and a accept button

Parameters:
msg - Message to show in the dialog
parentWindow - Parent window

messageBoxError

public void messageBoxError(java.lang.String msg,
                            java.lang.Object parentWindow,
                            java.util.ArrayList<java.lang.Exception> exception)
Muestra un dialogo de error con un texto y un botón de aceptar. Se le pasa como último parámetros una lista de excepciones que serán guardadas en el log

Parameters:
msg - Mensaje a mostrar en el dialogo.
parentWindow - Ventana desde la que se lanza el dialogo
exception - Excepcion que ha sido recogida

messageBoxError

public void messageBoxError(java.lang.String msg,
                            java.lang.Object parentWindow,
                            java.lang.Exception exception)
Muestra un dialogo de error con un texto y un botón de aceptar. El error es registrado en el log de gvSIG con la excepcion que se le pase por parametro

Parameters:
msg - Mensaje a mostrar en el dialogo.
parentWindow - Ventana desde la que se lanza el dialogo
exception - Excepcion que ha sido recogida


Copyright © 2014 gvSIG Association. All Rights Reserved.