Skip to content

Commit 512225d

Browse files
committed
Add docs of functions
1 parent 3f82a2a commit 512225d

36 files changed

+1514
-57
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
{
3+
"type": "aggregate_function",
4+
"title": "ST_RasterMosaic_Agg",
5+
"id": "st_rastermosaic_agg",
6+
"signatures": [
7+
{
8+
"returns": "RASTER",
9+
"parameters": [
10+
{
11+
"name": "rasters",
12+
"type": "RASTER[]"
13+
},
14+
{
15+
"name": "options",
16+
"type": "VARCHAR[]"
17+
}
18+
]
19+
}
20+
],
21+
"summary": "Computes a mosaic of a set of input rasters",
22+
"see_also": [ "st_rasterunion_agg" ],
23+
"tags": [
24+
"construction"
25+
]
26+
}
27+
---
28+
29+
### Description
30+
31+
Returns a mosaic of a set of raster tiles into a single raster.
32+
33+
Tiles are considered as source rasters of a larger mosaic and the result dataset has as many
34+
bands as one of the input files.
35+
36+
`options` is optional, an array of parameters like [GDALBuildVRT](https://gdal.org/programs/gdalbuildvrt.html).
37+
38+
### Examples
39+
40+
```sql
41+
WITH __input AS (
42+
SELECT
43+
1 AS raster_id,
44+
ST_RasterFromFile(file) AS raster
45+
FROM
46+
glob('./test/data/mosaic/*.tiff')
47+
),
48+
SELECT
49+
ST_RasterMosaic_Agg(raster, options => ['-r', 'bilinear']) AS r
50+
FROM
51+
__input
52+
GROUP BY
53+
raster_id
54+
;
55+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
{
3+
"type": "aggregate_function",
4+
"title": "ST_RasterUnion_Agg",
5+
"id": "st_rasterunion_agg",
6+
"signatures": [
7+
{
8+
"returns": "RASTER",
9+
"parameters": [
10+
{
11+
"name": "rasters",
12+
"type": "RASTER[]"
13+
},
14+
{
15+
"name": "options",
16+
"type": "VARCHAR[]"
17+
}
18+
]
19+
}
20+
],
21+
"summary": "Computes the union of a set of input rasters",
22+
"see_also": [ "st_rastermosaic_agg" ],
23+
"tags": [
24+
"construction"
25+
]
26+
}
27+
---
28+
29+
### Description
30+
31+
Returns the union of a set of raster tiles into a single raster composed of at least one band.
32+
33+
Each tiles goes into a separate band in the result dataset.
34+
35+
`options` is optional, an array of parameters like [GDALBuildVRT](https://gdal.org/programs/gdalbuildvrt.html).
36+
37+
### Examples
38+
39+
```sql
40+
WITH __input AS (
41+
SELECT
42+
1 AS raster_id,
43+
ST_RasterFromFile(file) AS raster
44+
FROM
45+
glob('./test/data/bands/*.tiff')
46+
),
47+
SELECT
48+
ST_RasterUnion_Agg(raster, options => ['-resolution', 'highest']) AS r
49+
FROM
50+
__input
51+
GROUP BY
52+
raster_id
53+
;
54+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
{
3+
"id": "st_getbandcolorinterp",
4+
"title": "ST_GetBandColorInterp",
5+
"type": "scalar_function",
6+
"signatures": [
7+
{
8+
"returns": "INT",
9+
"parameters": [
10+
{
11+
"name": "raster",
12+
"type": "RASTER"
13+
},
14+
{
15+
"name": "bandnum",
16+
"type": "INT"
17+
}
18+
]
19+
}
20+
],
21+
"aliases": [],
22+
"summary": "Returns the color interpretation of a band in the raster",
23+
"see_also": [ "ST_GetBandColorInterpName" ],
24+
"tags": [ "property" ]
25+
}
26+
---
27+
28+
### Description
29+
30+
Returns the color interpretation of a band in the raster.
31+
32+
This is a code in the enumeration:
33+
34+
+ Undefined = 0: Undefined
35+
+ GrayIndex = 1: Greyscale
36+
+ PaletteIndex = 2: Paletted (see associated color table)
37+
+ RedBand = 3: Red band of RGBA image
38+
+ GreenBand = 4: Green band of RGBA image
39+
+ BlueBand = 5: Blue band of RGBA image
40+
+ AlphaBand = 6: Alpha (0=transparent, 255=opaque)
41+
+ HueBand = 7: Hue band of HLS image
42+
+ SaturationBand = 8: Saturation band of HLS image
43+
+ LightnessBand = 9: Lightness band of HLS image
44+
+ CyanBand = 10: Cyan band of CMYK image
45+
+ MagentaBand = 11: Magenta band of CMYK image
46+
+ YellowBand = 12: Yellow band of CMYK image
47+
+ BlackBand = 13: Black band of CMYK image
48+
+ YCbCr_YBand = 14: Y Luminance
49+
+ YCbCr_CbBand = 15: Cb Chroma
50+
+ YCbCr_CrBand = 16: Cr Chroma
51+
52+
### Examples
53+
54+
```sql
55+
SELECT ST_GetBandColorInterp(raster, 1) FROM './test/data/mosaic/SCL.tif-land-clip00.tiff';
56+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
{
3+
"id": "st_getbandcolorinterpname",
4+
"title": "ST_GetBandColorInterpName",
5+
"type": "scalar_function",
6+
"signatures": [
7+
{
8+
"returns": "VARCHAR",
9+
"parameters": [
10+
{
11+
"name": "raster",
12+
"type": "RASTER"
13+
},
14+
{
15+
"name": "bandnum",
16+
"type": "INT"
17+
}
18+
]
19+
}
20+
],
21+
"aliases": [],
22+
"summary": "Returns the color interpretation name of a band in the raster",
23+
"see_also": [ "ST_GetBandColorInterp" ],
24+
"tags": [ "property" ]
25+
}
26+
---
27+
28+
### Description
29+
30+
Returns the color interpretation name of a band in the raster.
31+
32+
This is a string in the enumeration:
33+
34+
+ Undefined: Undefined
35+
+ Greyscale: Greyscale
36+
+ Paletted: Paletted (see associated color table)
37+
+ Red: Red band of RGBA image
38+
+ Green: Green band of RGBA image
39+
+ Blue: Blue band of RGBA image
40+
+ Alpha: Alpha (0=transparent, 255=opaque)
41+
+ Hue: Hue band of HLS image
42+
+ Saturation: Saturation band of HLS image
43+
+ Lightness: Lightness band of HLS image
44+
+ Cyan: Cyan band of CMYK image
45+
+ Magenta: Magenta band of CMYK image
46+
+ Yellow: Yellow band of CMYK image
47+
+ Black: Black band of CMYK image
48+
+ YLuminance: Y Luminance
49+
+ CbChroma: Cb Chroma
50+
+ CrChroma: Cr Chroma
51+
52+
### Examples
53+
54+
```sql
55+
SELECT ST_GetBandColorInterpName(raster, 1) FROM './test/data/mosaic/SCL.tif-land-clip00.tiff';
56+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
{
3+
"id": "st_getbandnodatavalue",
4+
"title": "ST_GetBandNoDataValue",
5+
"type": "scalar_function",
6+
"signatures": [
7+
{
8+
"returns": "DOUBLE",
9+
"parameters": [
10+
{
11+
"name": "raster",
12+
"type": "RASTER"
13+
},
14+
{
15+
"name": "bandnum",
16+
"type": "INT"
17+
}
18+
]
19+
}
20+
],
21+
"aliases": [],
22+
"summary": "Returns the NODATA value of a band in the raster",
23+
"see_also": [],
24+
"tags": [ "property" ]
25+
}
26+
---
27+
28+
### Description
29+
30+
Returns the NODATA value of a band in the raster.
31+
32+
### Examples
33+
34+
```sql
35+
SELECT ST_GetBandNoDataValue(raster, 1) FROM './test/data/mosaic/SCL.tif-land-clip00.tiff';
36+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
{
3+
"id": "st_getbandpixeltype",
4+
"title": "ST_GetBandPixelType",
5+
"type": "scalar_function",
6+
"signatures": [
7+
{
8+
"returns": "INT",
9+
"parameters": [
10+
{
11+
"name": "raster",
12+
"type": "RASTER"
13+
},
14+
{
15+
"name": "bandnum",
16+
"type": "INT"
17+
}
18+
]
19+
}
20+
],
21+
"aliases": [],
22+
"summary": "Returns the pixel type of a band in the raster",
23+
"see_also": [ "ST_GetBandPixelTypeName" ],
24+
"tags": [ "property" ]
25+
}
26+
---
27+
28+
### Description
29+
30+
Returns the pixel type of a band in the raster.
31+
32+
This is a code in the enumeration:
33+
34+
+ Unknown = 0: Unknown or unspecified type
35+
+ Byte = 1: Eight bit unsigned integer
36+
+ Int8 = 14: 8-bit signed integer
37+
+ UInt16 = 2: Sixteen bit unsigned integer
38+
+ Int16 = 3: Sixteen bit signed integer
39+
+ UInt32 = 4: Thirty two bit unsigned integer
40+
+ Int32 = 5: Thirty two bit signed integer
41+
+ UInt64 = 12: 64 bit unsigned integer
42+
+ Int64 = 13: 64 bit signed integer
43+
+ Float32 = 6: Thirty two bit floating point
44+
+ Float64 = 7: Sixty four bit floating point
45+
+ CInt16 = 8: Complex Int16
46+
+ CInt32 = 9: Complex Int32
47+
+ CFloat32 = 10: Complex Float32
48+
+ CFloat64 = 11: Complex Float64
49+
50+
### Examples
51+
52+
```sql
53+
SELECT ST_GetBandPixelType(raster, 1) FROM './test/data/mosaic/SCL.tif-land-clip00.tiff';
54+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
{
3+
"id": "st_getbandpixeltypename",
4+
"title": "ST_GetBandPixelTypeName",
5+
"type": "scalar_function",
6+
"signatures": [
7+
{
8+
"returns": "VARCHAR",
9+
"parameters": [
10+
{
11+
"name": "raster",
12+
"type": "RASTER"
13+
},
14+
{
15+
"name": "bandnum",
16+
"type": "INT"
17+
}
18+
]
19+
}
20+
],
21+
"aliases": [],
22+
"summary": "Returns the pixel type name of a band in the raster",
23+
"see_also": [ "ST_GetBandPixelType" ],
24+
"tags": [ "property" ]
25+
}
26+
---
27+
28+
### Description
29+
30+
Returns the pixel type name of a band in the raster.
31+
32+
This is a string in the enumeration:
33+
34+
+ Unknown: Unknown or unspecified type
35+
+ Byte: Eight bit unsigned integer
36+
+ Int8: 8-bit signed integer
37+
+ UInt16: Sixteen bit unsigned integer
38+
+ Int16: Sixteen bit signed integer
39+
+ UInt32: Thirty two bit unsigned integer
40+
+ Int32: Thirty two bit signed integer
41+
+ UInt64: 64 bit unsigned integer
42+
+ Int64: 64 bit signed integer
43+
+ Float32: Thirty two bit floating point
44+
+ Float64: Sixty four bit floating point
45+
+ CInt16: Complex Int16
46+
+ CInt32: Complex Int32
47+
+ CFloat32: Complex Float32
48+
+ CFloat64: Complex Float64
49+
50+
### Examples
51+
52+
```sql
53+
SELECT ST_GetBandPixelTypeName(raster, 1) FROM './test/data/mosaic/SCL.tif-land-clip00.tiff';
54+
```

0 commit comments

Comments
 (0)