# 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 %}
