# rasterSource

You can use **rasterSource** to build layers and widgets using **tables** stored in your data warehouse that contain:

* **CARTO Raster data:** continuous data across a surface represented by pixels (eg: temperature, land use, etc...) following the [RaQuet](https://github.com/CartoDB/raquet) specification by CARTO. [Learn more about using rasters in CARTO](/carto-user-manual/data-explorer/importing-data/importing-rasters.md).

## Usage

```typescript
import {rasterSource} from '@carto/api-client';

const data = rasterSource({
  tableName: 'carto-demo-data.demo_rasters.raster_table'
});
```

## Options

```typescript
type RasterSourceOptions = {
  tableName: string;
  widgetWorker?: boolean;
};
```

* **tableName**: The fully qualified name (FQN) of the pre-generated raster table you want to retrieve from your data warehouse. For example, for a BigQuery connection, `carto-demo-data.demo_rasters.raster_table` would be a valid table name.
* **widgetWorker** (optional): A boolean that enables or disables the use of Web Workers to perform [clent-side calculations](/carto-for-developers/reference/carto-widgets-reference/server-side-vs.-client-side.md#client-side-widget-calculation) for [widgets](/carto-for-developers/reference/carto-widgets-reference.md).

## Response

The response of `rasterSource` is a promise that can be resolved and used in [layers](https://github.com/CartoDB/gitbook-documentation/blob/master/carto-for-developers/key-concepts/carto-for-deck.gl) and [widgets](/carto-for-developers/reference/carto-widgets-reference.md).

## Connection compatibility

| Connection Data Warehouse                                                      | Compatible           |
| ------------------------------------------------------------------------------ | -------------------- |
| [BigQuery](/carto-user-manual/connections/bigquery.md)                         | :white\_check\_mark: |
| [Snowflake](/carto-user-manual/connections/snowflake.md)                       | :white\_check\_mark: |
| [Redshift](/carto-user-manual/connections/redshift.md)                         | :x:                  |
| [Databricks](/carto-user-manual/connections/databricks.md)                     | :white\_check\_mark: |
| [Oracle](/carto-user-manual/connections/oracle.md)                             | :white\_check\_mark: |
| [PostgreSQL](/carto-user-manual/connections/postgresql.md)                     | :x:                  |
| [CARTO Data Warehouse](/carto-user-manual/connections/carto-data-warehouse.md) | :white\_check\_mark: |

## Layer compatibility

`rasterSource` is compatible with the following layers from the `@deck.gl/carto` module:

* [RasterTileLayer](https://deck.gl/docs/api-reference/carto/raster-tile-layer)

## Widget model compatibility

`rasterSource` is compatible with the following widget models:

* [getFormula](/carto-for-developers/reference/carto-widgets-reference/models/getformula.md)
* [getCategories](/carto-for-developers/reference/carto-widgets-reference/models/getcategories.md)
* [getHistogram](/carto-for-developers/reference/carto-widgets-reference/models/gethistogram.md)
* [getRange](/carto-for-developers/reference/carto-widgets-reference/models/getrange.md)
* [getScatter](/carto-for-developers/reference/carto-widgets-reference/models/getscatter.md)
* [getTimeSeries](/carto-for-developers/reference/carto-widgets-reference/models/gettimeseries.md)
* [getTable](/carto-for-developers/reference/carto-widgets-reference/models/gettable.md)

{% hint style="warning" %}
Widget models for rasters are calculated client side. Precision might be lower, especially at low zoom levels (ie: when covering a large surface of the earth). [Learn more about client-side widget calculations](/carto-for-developers/reference/carto-widgets-reference/server-side-vs.-client-side.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.carto.com/carto-for-developers/reference/data-sources/rastersource.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
