You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/sql/Raster-writer.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,71 @@ root
116
116
|-- geotiff: binary (nullable = true)
117
117
```
118
118
119
+
#### RS_AsCOG
120
+
121
+
Introduction: Returns a binary DataFrame from a Raster DataFrame. Each raster object in the resulting DataFrame is a [Cloud Optimized GeoTIFF](https://www.cogeo.org/) (COG) image in binary format. COG is a GeoTIFF that is internally organized to enable efficient range-read access over HTTP, making it ideal for cloud-hosted raster data.
122
+
123
+
Possible values for `compression`: `Deflate` (default), `LZW`, `JPEG`, `PackBits`. Case-insensitive.
124
+
125
+
`tileSize` must be a power of 2 (e.g., 128, 256, 512). Default value: `256`
126
+
127
+
Possible values for `quality`: any decimal number between 0 and 1. 0 means maximum compression and 1 means minimum compression. Default value: `0.2`
128
+
129
+
Possible values for `resampling`: `Nearest` (default), `Bilinear`, `Bicubic`. Case-insensitive. This controls the resampling algorithm used to build overview levels.
130
+
131
+
`overviewCount` controls the number of overview levels. Use `-1` for automatic (default), `0` for no overviews, or any positive integer for a specific count.
SELECT RS_AsCOG(raster, 'LZW') FROM my_raster_table
159
+
```
160
+
161
+
SQL Example
162
+
163
+
```sql
164
+
SELECT RS_AsCOG(raster, 'LZW', 512, 0.75, 'Bilinear', 3) FROM my_raster_table
165
+
```
166
+
167
+
Output:
168
+
169
+
```html
170
+
+--------------------+
171
+
| cog|
172
+
+--------------------+
173
+
|[4D 4D 00 2A 00 0...|
174
+
+--------------------+
175
+
```
176
+
177
+
Output schema:
178
+
179
+
```sql
180
+
root
181
+
|-- cog: binary (nullable = true)
182
+
```
183
+
119
184
#### RS_AsPNG
120
185
121
186
Introduction: Returns a PNG byte array, that can be written to raster files as PNGs using the [sedona function](#write-a-binary-dataframe-to-raster-files). This function can only accept pixel data type of unsigned integer. PNG can accept 1 or 3 bands of data from the raster, refer to [RS_Band](Raster-operators.md#rs_band) for more details.
Copy file name to clipboardExpand all lines: docs/tutorial/raster.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -527,6 +527,14 @@ Use [RS_AsGeoTiff](../api/sql/Raster-writer.md#rs_asgeotiff) to get the binary D
527
527
SELECT RS_AsGeoTiff(raster)
528
528
```
529
529
530
+
### As Cloud Optimized GeoTiff
531
+
532
+
Use [RS_AsCOG](../api/sql/Raster-writer.md#rs_ascog) to get the binary Dataframe of the raster in [Cloud Optimized GeoTiff](https://www.cogeo.org/) (COG) format. COG is ideal for cloud-hosted raster data because it supports efficient range-read access over HTTP.
533
+
534
+
```sql
535
+
SELECT RS_AsCOG(raster)
536
+
```
537
+
530
538
### As PNG
531
539
532
540
Use [RS_AsPNG](../api/sql/Raster-writer.md#rs_aspng) to get the binary Dataframe of the raster in PNG format.
0 commit comments