# Raster Data Wrapper Reference

{% hint style="info" %}
Raster HeavyConnect is currently a beta feature. The options and interface are liable to change in future releases to better streamline and optimize the raster representation process.
{% endhint %}

When creating a HeavyConnect table with the Raster Data Wrapper, the columns must be specified based on the contents of the raster file (if unknown, contents can be obtained using our [detection process](https://docs.heavy.ai/apis-and-interfaces/heavysql#options)). If using a non-auto `RASTER_POINT_TRANSFORM` option, the column types must correspond to the expected transformation result type.

### Examples

1. Create a foreign table from a raster file with one band. Tile size is determined by the raster file.

{% code overflow="wrap" %}

```sql
CREATE FOREIGN TABLE raster_table (x DOUBLE, y DOUBLE, band_1 INTEGER) SERVER default_local_raster WITH (file_path='<path>');
```

{% endcode %}

2. Create a foreign table from a raster file with one band and specify the tile size. This will group the data into 128x128 blocks to better optimize data access.

{% code overflow="wrap" %}

```sql
CREATE FOREIGN TABLE raster_table (x DOUBLE, y DOUBLE, band_1 INTEGER) SERVER default_local_raster WITH (file_path='<path>', raster_tile_width=128, raster_tile_height=128)
```

{% endcode %}

3. Create a foreign table from a raster file with multiple bands.

{% code overflow="wrap" %}

```sql
CREATE FOREIGN TABLE raster_table (x DOUBLE, y DOUBLE, band_1 INTEGER, band_2 FLOAT) SERVER default_local_raster WITH (file_path='<path>')
```

{% endcode %}

4. Create a foreign table from a raster file only selecting band\_2 from the file.

{% code overflow="wrap" %}

```sql
CREATE FOREIGN TABLE raster_table (x DOUBLE, y DOUBLE, band FLOAT) SERVER default_local_raster WITH (file_path='<path>', raster_filter_bands='band=band_2')
```

{% endcode %}

5. Create a foreign table from a raster file with no point transform.

{% code overflow="wrap" %}

```sql
CREATE FOREIGN TABLE raster_table (x SMALLINT, y SMALLINT, band FLOAT) SERVER default_local_raster WITH (file_path='<path>', raster_point_transform='none')
```

{% endcode %}


---

# 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.heavy.ai/v8.5.0/heavyconnect/raster-data-wrapper-reference.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.
