# Raster

In CARTO Builder, the Raster layer visualization option allows you to render and style raster data such as such as deforestation patterns, land classifications, or flood risk models, directly on your map.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-46648dd22e1d32982606a7655ffb597b9547726c%2Fimage%20(677).png?alt=media" alt=""><figcaption></figcaption></figure>

## Visualization

Within the **Advanced Visualization Options** <img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-0284a6e8c3b0d674f33e4bac8912e003925dd056%2Fimage.png?alt=media" alt="" data-size="line">, you can control the **opacity** of your raster layer, allowing you to blend it seamlessly with other layers on your map for improved visual clarity.

You can also use **Visibility by zoom level** to define the range of zoom levels at which your layer will be displayed. This ensures your map remains relevant by showing layers only at the appropriate scales.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-cf304efdbdd64d8fe4557a5c2af5288684824f12%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Style

A raster layer can be styled in the following manners:

* **Color Range**: Ideal for continuous data like elevation or temperature ranges.
* **Unique:** Best for categorical data such as land use classification or vegetation types.
* **RGB**: Suitable for visualizing satellite imagery sources to obtain true-color or false-color composite.

### Color Range

Color Range allows you to style a band by different ranges. The Color Range will be used by default if you have 'Grey' as the Color Interpreter in your raster metadata band. Learn more about Color Interpreter here.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-f3b4d4fdd8b7e7d26e68bf1a667072cab04f05e6%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Quantiles color scale is available only if the `quantile` stat has been added to the specific band during the raster-loader process.
{% endhint %}

### Unique

Unique style allows you to style discrete numeric bands using unique color values. The Unique style will be used by default if you have 'Palette' as the [Color Interpreter](#color-interpreter) by default. Learn more about Color Interpreter here.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-d461f02536b47b7502eeb006d56f2c9452a107fa%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Unique style is only available for rasters containing at least a discrete numeric band containing `top_values` stat in the raster band metadata.
{% endhint %}

### RGB

RGB styles allows you to assign bands to the `red`, `green` and `blue` channel spectrum. The RGB style will be used by default when red, green and blue bands are color interpreter in the metadata. Learn more about [Color Interpreter](#color-interpreter) here.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-07f6a29b9f8a02db3bae4dc8af49be3c55ba062a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Custom expressions

Here you can select specific bands as well as adding your own custom expressions. To add a *custom expression*, simply type in the selector menu the expression you want to add. You must ensure the syntax is correct before adding an expression.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-febae615e4afc0449343154a13e5f94ecc25a8f1%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Color interpreter**

If your original raster includes a **Color Interpreter**, this will be respected during the uploading process and will be used by default to style your raster layer in CARTO Builder. The current **Color Interpreter types** supported, based on [GDAL data model](https://gdal.org/en/latest/user/raster_data_model.html), are as follows:

* **Palette**: For discrete numeric bands, the **Unique style** will be applied by default. This type supports a **Color Table**, which defines the relationship between numeric values and colors.
* **Gray**: For bands with a gray interpreter, a grayscale palette is applied using the **Color Range** and **Quantize color scale** for smoother visualization.
* **Red, Green, and Blue (RGB)**: When bands are interpreted as red, green, and blue, the **RGB style** is used by default. Each band is assigned to the corresponding red, green, or blue channel to render a composite image.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-eaa90aeb2f99520efc5929e0192b93a71aaea049%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### No data value

CARTO Builder will not render any pixels assigned the **No Data Value** for each band. For example, if the no data value for a specific band is set to `0`, any pixels with this value will not appear in the visualization.

For **RGB rasters**, the no data value must match across all three bands (red, green, and blue) for a pixel to be ignored. For instance, if the no data values are set to `0` for these bands, the corresponding pixel will be excluded from rendering only when all three bands have a value of `0`.

Learn more about data preparation and no data value assignment in this [section](https://docs.carto.com/carto-user-manual/data-explorer/importing-data/importing-rasters).
