com.esri.arcgis.geoprocessing.tools.datamanagementtools
Class Resample
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.datamanagementtools.Resample
- All Implemented Interfaces:
- GPTool
public class Resample
- extends AbstractGPTool
Alters the raster dataset by changing the cell size and resampling method.
The Resample tool is contained in the Data Management Tools tool box.
Usage tips:
- The cell size can be changed, but the extent of the raster dataset will remain the same.
- This tool can only output a square cell size.
- You can save your output to BIL, BIP, BMP, BSQ, DAT, GIF, GRID, IMG, JPEG, JPEG 2000, PNG, TIFF, or any geodatabase raster dataset.
- There are four options for the Resampling Technique parameter:
- The NEAREST option, which performs a nearest neighbor assignment, is the fastest of the interpolation methods. It is used primarily for discrete data, such as a land-use classification, since it will not change the values of the cells. The maximum spatial error will be one-half the cell size.
- The MAJORITY option, which performs a majority algorithm, determines the new value of the cell based on the most popular values within the filter window. It is mainly used with discrete data just as the nearest neighbor method; Majority tends to give a smoother result than Nearest.
- The BILINEAR option, which performs a bilinear interpolation, determines the new value of a cell based on a weighted distance average of the four nearest input cell centers. It is useful for continuous data and will cause some smoothing of the data.
- The CUBIC option, which performs a cubic convolution, determines the new value of a cell based on fitting a smooth curve through the 16 nearest input cell centers. It is appropriate for continuous data, although it may result in the output raster containing values outside the range of the input raster. It is geometrically less distorted than the raster achieved by running the nearest neighbor resampling algorithm. The disadvantage of the Cubic option is that it requires more processing time. In some cases, it can result in output cell values outside the range of input cell values. If this is unacceptable, use Bilinear instead.
The Bilinear and Cubic options should not be used with categorical data, since the cell values may be altered.
- The lower left corner of the output raster dataset will be the same map space coordinate location as the lower left corner of the input raster dataset.
- The numbers of rows and columns in the output raster are determined as follows:columns = (xmax - xmin) / cell size rows = (ymax - ymin) / cell size
- If there is any remainder from the above equations, rounding of the number of columns and/or rows is performed.
Constructor Summary |
Resample()
Creates the Resample tool with defaults. |
Resample(java.lang.Object inRaster,
java.lang.Object outRaster)
Creates the Resample tool with the required parameters. |
Method Summary |
java.lang.Object |
getCellSize()
Returns the Output Cell Size parameter of this tool . |
java.lang.Object |
getInRaster()
Returns the Input Raster parameter of this tool . |
java.lang.Object |
getOutRaster()
Returns the Output Raster Dataset parameter of this tool . |
java.lang.String |
getResamplingType()
Returns the Resampling Techinque parameter of this tool . |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
void |
setCellSize(java.lang.Object cellSize)
Sets the Output Cell Size parameter of this tool . |
void |
setInRaster(java.lang.Object inRaster)
Sets the Input Raster parameter of this tool . |
void |
setOutRaster(java.lang.Object outRaster)
Sets the Output Raster Dataset parameter of this tool . |
void |
setResamplingType(java.lang.String resamplingType)
Sets the Resampling Techinque parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Resample
public Resample()
- Creates the Resample tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
Resample
public Resample(java.lang.Object inRaster,
java.lang.Object outRaster)
- Creates the Resample tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
inRaster
- the input raster dataset.outRaster
- the output raster dataset. when storing the raster dataset in a file format, you need to specify the file extension: when storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. when storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a compression type and compression quality.
getInRaster
public java.lang.Object getInRaster()
- Returns the Input Raster parameter of this tool .
This parameter is the input raster dataset.
This is a required parameter.
- Returns:
- the Input Raster
setInRaster
public void setInRaster(java.lang.Object inRaster)
- Sets the Input Raster parameter of this tool .
This parameter is the input raster dataset.
This is a required parameter.
- Parameters:
inRaster
- the input raster dataset.
getOutRaster
public java.lang.Object getOutRaster()
- Returns the Output Raster Dataset parameter of this tool .
This parameter is the output raster dataset. when storing the raster dataset in a file format, you need to specify the file extension: when storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. when storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a compression type and compression quality.
This is a required parameter.
- Returns:
- the Output Raster Dataset
setOutRaster
public void setOutRaster(java.lang.Object outRaster)
- Sets the Output Raster Dataset parameter of this tool .
This parameter is the output raster dataset. when storing the raster dataset in a file format, you need to specify the file extension: when storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. when storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a compression type and compression quality.
This is a required parameter.
- Parameters:
outRaster
- the output raster dataset. when storing the raster dataset in a file format, you need to specify the file extension: when storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. when storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a compression type and compression quality.
getCellSize
public java.lang.Object getCellSize()
- Returns the Output Cell Size parameter of this tool .
This parameter is the cell size for the new raster dataset.
This is an optional parameter.
- Returns:
- the Output Cell Size
setCellSize
public void setCellSize(java.lang.Object cellSize)
- Sets the Output Cell Size parameter of this tool .
This parameter is the cell size for the new raster dataset.
This is an optional parameter.
- Parameters:
cellSize
- the cell size for the new raster dataset.
getResamplingType
public java.lang.String getResamplingType()
- Returns the Resampling Techinque parameter of this tool .
This parameter is the resampling algorithm to be used. The default is NEAREST.
This is an optional parameter.
- Returns:
- the Resampling Techinque
setResamplingType
public void setResamplingType(java.lang.String resamplingType)
- Sets the Resampling Techinque parameter of this tool .
This parameter is the resampling algorithm to be used. The default is NEAREST.
This is an optional parameter.
- Parameters:
resamplingType
- the resampling algorithm to be used. The default is NEAREST.
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias