Operations: Resample raster

From ILWIS
Jump to: navigation, search
Main Page Arrow.png Operations
Resample raster
Resample Raster

The Resample raster operation resamples a raster map from the map's current georeference to another georeference. The coordinate of each output pixel is used to calculate a new value from close-by pixel values in the input map. Three interpolation methods are available for resampling: nearest neighbor, bilinear interpolation, and bicubic.
The Resample raster operation can be applied via ILWIS-Python editor or via ILWIS Main window, Toolbar and the Operatins tab. The required Python syntax is:


name of the output raster coverage = ilwis.Engine.do(name of the operation, name of input raster coverage, name of the target georeference, "resampling method")


Then, the Python syntax for the above mentioned operation is:


resampledraster = ilwis.Engine.do("resample", “file:///C:/my director/my raster”, “file:///C:/mydirector/my georeference”, "resampling method")


In general, the URL used in the Python syntax can be replaced with variable name created via using Python. For example: you can open a raster coverage or a georeference as variables and give them a name as the following:


rc = ilwis.RasterCoverage("file:///C:/my director/my raster.mpr") georef = ilwis.GeoReference("file:///C:/my director/my georef.grf")


Once these variable is created via ILWIS-Python editor, then they can be used directly in Python syntax without quotation mark and the path as the following:


resampledraster = ilwis.Engine.do("resample", rc, georef, "bicubic")

Figure 1, Resample operation form


To start the Resample raster operation from ILWIS main window:

Mar.jpg
  • Click the Operation tab on toolbar tabs
  • From the opened operation list select Resample raster

Once the Resample raster operation is selected from the list, an operation form will be opened in which you can set parameters required for that operation including input(s), output(s), memory location and data format (Figure 1).

To successfully execute this operation, you need to complete the form with proper inputs data. The inputs data must be dragged from the catalog and dropped in their corresponding fields in the form.

input raster coverage: Select an input raster map to be resampled. The input raster map may not use georef None.
target georeference: Select an existing target georeference for the output raster map(s) to which the input map(s) should be resampled.
Resampling method: Select a resampling method: Nearest Neighbor, Bilinear, or Bicubic.
  • For nearest neighbor resampling, the input map can have any domain.
  • For bilinear resampling, the input map should use either value or color domain.
  • For bicubic resampling, the input map has to use a value domain.
output raster coverage: Type a name for the output raster map that will contain resampled pixels.
Output format: Select a format to save the output raster map. The default format is “Memory”; if you select it, the output will be temporally saved in the internal catalog and will be removed when you exit the program. If you select other format, the output will be saved in the active catalog.
Execute: Click the “Execute“ button to run this operation.