Resample (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Alters the proportions of a raster dataset by changing the cell size. The cell size will be changed, but the extent of the raster dataset will remain the same.
Illustration
Usage tips
Command line and Scripting
You can save your output to BMP, GIF, GRID, IMG, JPEG, JPEG2000, PNG, TIFF, or any geodatabase raster dataset.
When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID.
When storing your raster dataset to a geodatabase, you can specify a compression type and compression quality within the Raster Storage Settings in the Environment Settings dialog box.
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 landuse 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 neighbor.
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, then rounding of the number of columns and/or rows is performed.
The following environments affect this tool: current workspace, scratch workspace, output coordinate system, output extent, output CONFIG keyword, pyramid, raster statistics, compression, and tile size.
Map Algebra
The current environment settings of cell size (if one is specified) and extent are applied to the output. The mask is not used.
The NEAREST option, which performs a nearest neighbor assignment, is the fastest of the four interpolation methods. It is used primarily for categorical data, such as a landuse classification, since it will not change the values of the cells. The maximum spatial error will be one-half the {cellsize}.
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 dataset 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 SEARCH option assigns the value for the output cell by searching from its center for the nearest cell of the raster dataset being resampled with a value (not NoData) within the output cell area. The SEARCH option is useful for rasters having points or line features on a NoData background. This option ensures that no point features will be missed and that line features will be preserved as continuous.
The SEARCH option is appropriate for resampling categorical data to a coarser resolution when it is important to preserve foreground cells surrounded by a NoData background.
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 will be the same map space coordinate location as the lower left corner of the input raster.
The numbers of rows and columns in the output raster are determined as follows:
columns = (xmax - xmin) / cell size rows = (ymax - ymin) / cell sizeIf there is any remainder from the above equations, then rounding of the number of columns and/or rows is performed.
When typing a Map Algebra expression into the Spatial Analyst Raster Calculator, if the input raster dataset is a grid and resides in the working directory (set on the General tab of the Options dialog), type the name of the grid directly into the expression: "slope(ingrid1)".
If the grid dataset does not reside in your working directory, type the path to the grid dataset on disk: "slope(c:\SpatialData\ingrid1)".All other raster datasets (for example, TIFF) cannot be accessed directly from disk. To input other raster data (including grids) into an expression, you must first add the dataset as a layer to ArcMap. The layers will be displayed in the Layers list of the Raster Calculator. When entering the raster into a Map Algebra expression, it must be surrounded by square brackets: "slope([inlayer1])".
Command line syntax
An overview of the Command Line window
Resample_management <in_raster> <out_raster> {cell_size} {NEAREST | BILINEAR | CUBIC | MAJORITY}
Parameter | Explanation | Data Type |
<in_raster> |
The input raster dataset. |
Composite Geodataset |
<out_raster> |
The output raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID. When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. A raster dataset stored in a geodatabase can be compressed; you can specify a compression type and compression quality. |
Raster Dataset |
{cell_size} |
The cell size for the output raster dataset. The default cell size is the cell size of the input raster dataset. |
Analysis Cell Size |
{NEAREST | BILINEAR | CUBIC | MAJORITY} |
Specifies the resampling algorithm to be used when resampling the raster dataset.
|
String |
resample_management D:\images.mdb\raster D:\images.mdb\resamp_raster 30 BILINEAR
Scripting syntax
About getting started with writing geoprocessing scripts
Resample_management (in_raster, out_raster, cell_size, resampling_type)
Parameter | Explanation | Data Type |
in_raster (Required) |
The input raster dataset. |
Composite Geodataset |
out_raster (Required) |
The output raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID. When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. A raster dataset stored in a geodatabase can be compressed; you can specify a compression type and compression quality. |
Raster Dataset |
cell_size (Optional) |
The cell size for the output raster dataset. The default cell size is the cell size of the input raster dataset. |
Analysis Cell Size |
resampling_type (Optional) |
Specifies the resampling algorithm to be used when resampling the raster dataset.
|
String |
# Create the geoprocessing object import arcgisscripting gp = arcgisscripting.create() gp.workspace = "c:/redlands_data" gp.Resample_management("redlands1.tif","redlands_resample.img" , "30","BILINEAR")
Map Algebra syntax
Resample(<grid>, {cellsize}, {NEAREST | BILINEAR | CUBIC | SEARCH})
Parameter | Explanation |
<grid> | The name of the input raster. |
{cellsize} | The output cell size.
The default is the current environment setting set on the Cell Size tab of the Options dialog box. |
{NEAREST | BILINEAR | CUBIC | SEARCH} | Specifies the resampling algorithm to be used when resampling the raster.
|
resample(ingrid, .5) resample(ingrid1, 23.5, cubic) resample(ingrid1 + ingrid2, 4) resample(ingrid, 2000, bilinear)
ArcObjects syntax
There is no corresponding Spatial Analyst object to perform Resample. However, in core ArcGIS, similar functionality can be found in the IRasterGeometryProc object.