Introduction: Creates a raster from the given array of pixel values. The width, height, geo-reference information, and the CRS will be taken from the given reference raster. The data type of the resulting raster will be DOUBLE and the number of bands of the resulting raster will be data.length / (refRaster.width * refRaster.height).
Since: v1.6.0
Format: RS_MakeRaster(refRaster: Raster, bandDataType: String, data: ARRAY[Double])
RS_MakeEmptyRaster function for the accepted values.SQL example:
WITH r AS (SELECT RS_MakeEmptyRaster(2, 3, 2, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 4326) AS rast) SELECT RS_AsMatrix(RS_MakeRaster(rast, 'D', ARRAY(1, 2, 3, 4, 5, 6))) FROM r
Output:
+------------------------------------------------------------+ |rs_asmatrix(rs_makeraster(rast, D, array(1, 2, 3, 4, 5, 6)))| +------------------------------------------------------------+ ||1.0 2.0 3.0|\n|4.0 5.0 6.0|\n | +------------------------------------------------------------+