Create Table using CREATE TABLE Command
To create a table with raster column in WherobotsDB, use sedona.sql(...) to run a CREATE TABLE command:
- Python
- Scala
- Java
raster to represent raster data. Data in columns with rast type will be loaded as RasterUDT values in WherobotsDB; users can use any RS_ functions provided by WherobotsDB to manipulate the raster data.
Create Table using DataFrame
User can also create a table using a DataFrame. Theraster column in the DataFrame will go into the raster column in the created geospatial table, as described in Load Raster Data.
Then we can write this DataFrame to a Havasu table:
- Python
- Scala
- Java
ALTER TABLE, DROP TABLE, etc.
Writing Raster Data
Raster data in Havasu is similar to PostGIS. It provides two options for storing raster data:- in-db raster: raster data completely stored in a Havasu table.
- out-db raster: raster data is stored in an external file (such as GeoTIFF file on S3) and the Havasu table stores the path to the file and geo-referencing metadata of that raster.
In-DB Raster
To construct in-db raster data and write them to a Havasu table, user can useRS_FromGeoTiff to construct a raster value and write the DataFrame using .writeTo(...).append()
- Python
- Scala
- Java
RS_FromPath, then use RS_AsInDB to convert the out-db raster to in-db raster:
- Python
- Scala
- Java
Out-DB Raster
To construct out-db raster data and write them to a Havasu table, user can useRS_FromPath to construct a raster value and insert it into the table:
- Python
- Scala
- Java
UPDATE, DELETE, MERGE INTO, etc. Please refer to Apache Iceberg - Spark Writes for details.
Reading Raster Table
Havasu tables can be queried using SQLSELECT statements:
- Python
- Scala
- Java
- Python
- Scala
- Java
Processing Raster Data using Spatial SQL
Users can use anyRT_ functions provided by WherobotsDB to manipulate raster data read from Havasu.
- Python
- Scala
- Java

