> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RS_MakeRaster

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)`.

## Signatures

```sql theme={"system"}
RS_MakeRaster(rast: Raster, type: String, data: ARRAY[Double])
```

## Parameters

<ParamField body="rast" type="Raster" required>
  The reference raster from which width, height, geo-reference information, and CRS are taken.
</ParamField>

<ParamField body="type" type="String" required>
  The data type of the resulting raster bands.
</ParamField>

<ParamField body="data" type="ARRAY[Double]" required>
  The array of pixel values for the resulting raster.
</ParamField>

## Return type

<ResponseField type="Raster">
  The resulting raster.
</ResponseField>

## Example

```sql theme={"system"}
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
```

```
+------------------------------------------------------------+
|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                          |
+------------------------------------------------------------+
```
