RasterReprojector¶
Reprojects a raster into another coordinate reference system, given by its code, as EPSG:32632 for WGS 84 / UTM zone 32N. The cells of the new grid are computed from the original ones with the chosen interpolation: nearest neighbour keeps the original values, as needed for maps of classes or codes, bilinear and bicubic smooth them, better for continuous values as the elevation. The cell size of the output can be set; if not, it is estimated from the original one.
Parameters¶
Reprojects a raster into another coordinate reference system, optionally with a new cell size.
Toolbox folder: Raster Processing
Status: Certified
Keywords: Raster, Reprojection, CRS
Authors: Andrea Antonello
Class: org.hortonmachine.modules.RasterReprojector
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
raster file |
The raster to reproject. |
||
|
Double |
The optional cell size in x of the output. |
||
|
Double |
The optional cell size in y of the output. |
||
|
CRS code |
The code of the target coordinate reference system, as EPSG:32632. |
||
|
String |
|
The interpolation of the new cells: nearest neighbour keeps the original values, as needed for classes and codes; bilinear and bicubic smooth them. Allowed values: |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
The reprojected raster. |
Example¶
The example runs on the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data, each module on the outputs of the previous ones:
import org.hortonmachine.modules.RasterReprojector
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
// from Monte Mario / Italy zone 1 to WGS 84 / UTM zone 32N
var reprojector = new RasterReprojector()
reprojector.inRaster = folder + "dtm_flanginec.tif"
reprojector.pCode = "EPSG:32632"
reprojector.outRaster = folder + "dtm_utm.tif"
reprojector.process()