Skip to content

Warp

The Warp operator puts a raster onto another grid in one step: another spatial reference, another resolution and another grid origin, in any combination.

The output resolution can be coarser or finer than the input resolution, also coarser in one axis and finer in the other. By default, each output pixel takes the value of the input pixel under its center. downsampling and upsampling choose other methods, with the semantics of gdalwarp -r: downsampling applies to outputs that are coarser than the input in at least one axis, upsampling to outputs that are finer in both axes. With another spatial reference, coarser and finer are relative to the resolution of the reprojected input, and the footprint of an output pixel is the bounding box of its projected corners, as in GDAL.

Integer outputs of average and bilinear round half up. outputDataType keeps the fractions, e.g. F32 for the average of U8 values.

Geo Engine uses Warp to answer queries, e.g., WMS requests, in a spatial reference or at a resolution that differs from the processing graph’s.

The operator returns an error if the input has no spatial reference, if the input data cannot be reprojected to the target spatial reference, or if mode is used with a float input or could need more memory than the limit [query_context] warp_mode_max_memory_per_tile_mb.

Name Type Description Examples
targetSpatialReference string,null Target spatial reference system. Defaults to the spatial reference of the input. "EPSG:3857"
outputResolution SpatialResolution or null {"x":0.5,"y":0.5}
outputOriginReference Coordinate2D or null
downsampling WarpDownsamplingMethod How to compute an output pixel that is coarser than the input in at least one axis.
Defaults to nearest.
"average"
upsampling WarpUpsamplingMethod How to compute an output pixel that is finer than the input in both axes.
Defaults to nearest.
"bilinear"
outputDataType RasterDataType or null "F32"
deriveOutSpec DeriveOutRasterSpecsSource How the output grid is derived when reprojecting, as in Reprojection:
projectionBounds (default) derives it from the area of use of the input’s spatial
reference, dataBounds from the data bounds.
approximationErrorThreshold number,null The largest error in input pixels of the approximate coordinate transformation when
reprojecting, as gdalwarp -et. 0 projects every pixel exactly. Defaults to the server’s
[query_context] reprojection_approximation_error_px (0.125 by default).
0.125
0
Name Type Description
raster RasterOperator An operator that produces raster data.
{
"type": "Warp",
"params": {
"targetSpatialReference": "EPSG:3857",
"outputResolution": {
"x": 20000,
"y": 10000
}
},
"sources": {
"raster": {
"type": "GdalSource",
"params": {
"data": "ndvi"
}
}
}
}
{
"type": "Warp",
"params": {
"outputResolution": {
"x": 0.5,
"y": 0.5
},
"downsampling": "average",
"upsampling": "bilinear",
"outputDataType": "F32"
},
"sources": {
"raster": {
"type": "GdalSource",
"params": {
"data": "ndvi"
}
}
}
}