'Return a warped GDALRaster with the given input characteristics.
The input is expected to be a dictionary containing the parameters
of the target raster. Allowed values are width, height, SRID, origin,
scale, skew, datatype, driver, and name (filename).
By default, the warp functions keeps all parameters equal to the values
of the original source raster. For the name of the target raster, the
name of the source raster will be used and appended with
_copy. + source_driver_name.
In addition, the resampling algorithm can be specified with the "resampling"
input parameter. The default is NearestNeighbor. For a list of all options
consult the GDAL_RESAMPLE_ALGORITHMS constant.'

def warp(self, ds_input, resampling='NearestNeighbour', max_error=0.0):

    if ('width' not in ds_input):
        ds_input['width'] = self.width
    if ('height' not in ds_input):
        ds_input['height'] = self.height
    if ('srid' not in ds_input):
        ds_input['srid'] = self.srs.srid
    if ('origin' not in ds_input):
        ds_input['origin'] = self.origin
    if ('scale' not in ds_input):
        ds_input['scale'] = self.scale
    if ('skew' not in ds_input):
        ds_input['skew'] = self.skew
    if ('driver' not in ds_input):
        ds_input['driver'] = self.driver.name
    if ('name' not in ds_input):
        ds_input['name'] = ((self.name + '_copy.') + self.driver.name)
    if ('datatype' not in ds_input):
        ds_input['datatype'] = self.bands[0].datatype()
    ds_input['bands'] = [{'nodata_value': bnd.nodata_value} for bnd in self.bands]
    target = GDALRaster(ds_input, write=True)
    algorithm = GDAL_RESAMPLE_ALGORITHMS[resampling]
    capi.reproject_image(self._ptr, self.srs.wkt.encode(), target._ptr, target.srs.wkt.encode(), algorithm, 0.0, max_error, c_void_p(), c_void_p(), c_void_p())
    target._flush()
    return target
