栅格管理 |
AddRasterConstraints
将栅格约束添加到已加载的栅格表中,用于特定列,该列约束了空间参考、比例、块大小、对齐、波段、波段类型以及一个标志,用于表示栅格列是否被规则地分块。表必须加载数据才能推断出约束。如果约束设置成功,则返回 true,否则会发出通知。
- rasttable, rastcolumn, srid=true, scale_x=true, scale_y=true, blocksize_x=true, blocksize_y=true, same_alignment=true, regular_blocking=false, num_bands=true, pixel_types=true, nodata_values=true, out_db=true, extent=true
- rasttable, rastcolumn, VARIADIC constraints
- rastschema, rasttable, rastcolumn, VARIADIC constraints
- rastschema, rasttable, rastcolumn, srid=true, scale_x=true, scale_y=true, blocksize_x=true, blocksize_y=true, same_alignment=true, regular_blocking=false, num_bands=true, pixel_types=true, nodata_values=true, out_db=true, extent=true
|
DropRasterConstraints
删除引用栅格表列的 PostGIS 栅格约束。 如果您需要重新加载数据或更新栅格列数据,则非常有用。
- rasttable, rastcolumn, srid, scale_x, scale_y, blocksize_x, blocksize_y, same_alignment, regular_blocking, num_bands=true, pixel_types=true, nodata_values=true, out_db=true, extent=true
- rastschema, rasttable, rastcolumn, srid=true, scale_x=true, scale_y=true, blocksize_x=true, blocksize_y=true, same_alignment=true, regular_blocking=false, num_bands=true, pixel_types=true, nodata_values=true, out_db=true, extent=true
- rastschema, rasttable, rastcolumn, constraints
|
AddOverviewConstraints
将栅格列标记为另一栅格列的概述。
- ovschema, ovtable, ovcolumn, refschema, reftable, refcolumn, ovfactor
- ovtable, ovcolumn, reftable, refcolumn, ovfactor
|
DropOverviewConstraints
取消栅格列作为另一栅格列概览的标记。
- ovschema, ovtable, ovcolumn
- ovtable, ovcolumn
|
PostGIS_GDAL_Version
()
报告 PostGIS 使用的 GDAL 库的版本。 |
PostGIS_Raster_Lib_Build_Date
()
报告完整的栅格库构建日期。 |
PostGIS_Raster_Lib_Version
()
报告完整的栅格版本和构建配置信息。 |
ST_GDALDrivers
()
通过 GDAL 返回 PostGIS 支持的栅格格式列表。 ST_AsGDALRaster 仅可使用 can_write=True 的格式 |
ST_Contour
(rast, bandnumber, level_interval, level_base, fixed_levels, polygonize)
使用 GDAL 轮廓算法从提供的栅格波段生成一组矢量轮廓。 |
ST_InterpolateRaster
(input_points, algorithm_options, template, template_band_num=1)
基于输入的 3 维点集插值网格表面,使用 X 和 Y 值在网格上定位点,并使用点的 Z 值作为表面高程。 |
UpdateRasterSRID
更改用户指定的列和表中所有栅格的 SRID。
- schema_name, table_name, column_name, new_srid
- table_name, column_name, new_srid
|
ST_CreateOverview
(tab, col, factor, algo='NearestNeighbor')
创建给定栅格覆盖范围的降低分辨率版本。 |
栅格构造器 |
ST_AddBand
返回一个栅格,其中在给定索引位置添加了给定类型的新波段和给定初始值。 如果未指定索引,则将带添加到末尾。
- rast, addbandargset
- rast, index, pixeltype, initialvalue=0, nodataval=NULL
- rast, pixeltype, initialvalue=0, nodataval=NULL
- torast, fromrast, fromband=1, torastindex=at_end
- torast, fromrasts, fromband=1, torastindex=at_end
- rast, index, outdbfile, outdbindex, nodataval=NULL
- rast, outdbfile, outdbindex, index=at_end, nodataval=NULL
|
ST_AsRaster
将 PostGIS 几何图形转换为 PostGIS 栅格。
- geom, ref, pixeltype, value=1, nodataval=0, touched=false
- geom, ref, pixeltype=ARRAY['8BUI'], value=ARRAY[1], nodataval=ARRAY[0], touched=false
- geom, scalex, scaley, gridx, gridy, pixeltype, value=1, nodataval=0, skewx=0, skewy=0, touched=false
- geom, scalex, scaley, gridx=NULL, gridy=NULL, pixeltype=ARRAY['8BUI'], value=ARRAY[1], nodataval=ARRAY[0], skewx=0, skewy=0, touched=false
- geom, scalex, scaley, pixeltype, value=1, nodataval=0, upperleftx=NULL, upperlefty=NULL, skewx=0, skewy=0, touched=false
- geom, scalex, scaley, pixeltype, value=ARRAY[1], nodataval=ARRAY[0], upperleftx=NULL, upperlefty=NULL, skewx=0, skewy=0, touched=false
- geom, width, height, gridx, gridy, pixeltype, value=1, nodataval=0, skewx=0, skewy=0, touched=false
- geom, width, height, gridx=NULL, gridy=NULL, pixeltype=ARRAY['8BUI'], value=ARRAY[1], nodataval=ARRAY[0], skewx=0, skewy=0, touched=false
- geom, width, height, pixeltype, value=1, nodataval=0, upperleftx=NULL, upperlefty=NULL, skewx=0, skewy=0, touched=false
- geom, width, height, pixeltype, value=ARRAY[1], nodataval=ARRAY[0], upperleftx=NULL, upperlefty=NULL, skewx=0, skewy=0, touched=false
|
ST_Band
返回现有栅格的一个或多个波段作为新栅格。 对于从现有栅格构建新栅格非常有用。
- rast, nbands = ARRAY[1]
- rast, nband
- rast, nbands, delimiter=,
|
ST_MakeEmptyCoverage
(tilewidth, tileheight, width, height, upperleftx, upperlefty, scalex, scaley, skewx, skewy, srid=unknown)
用空栅格图块网格覆盖地理参考区域。 |
ST_MakeEmptyRaster
返回一个空白栅格(不包含波段),其具有给定的尺寸(宽度和高度)、左上角 X 和 Y 坐标、像素大小和旋转参数(scalex、scaley、skewx 和 skewy),以及参考系统(SRID)。如果传递了一个栅格,则返回一个具有相同大小、对齐方式和 SRID 的新栅格。如果省略了 SRID,则空间参考将设置为未知(0)。
- rast
- width, height, upperleftx, upperlefty, scalex, scaley, skewx, skewy, srid=unknown
- width, height, upperleftx, upperlefty, pixelsize
|
ST_Tile
返回根据输出栅格的所需维度分割输入栅格而产生的一组栅格。
- rast, nband, width, height, padwithnodata=FALSE, nodataval=NULL
- rast, nband, width, height, padwithnodata=FALSE, nodataval=NULL
- rast, width, height, padwithnodata=FALSE, nodataval=NULL
|
ST_Retile
(tab, col, ext, sfx, sfy, tw, th, algo='NearestNeighbor')
从任意平铺的栅格覆盖范围返回一组配置的平铺。 |
ST_FromGDALRaster
(gdaldata, srid=NULL)
从受支持的 GDAL 栅格文件返回栅格。 |
栅格访问器 |
ST_GeoReference
(rast, format=GDAL)
返回 GDAL 或 ESRI 格式的地理配准元数据,如世界文件中常见的格式。 默认为 GDAL。 |
ST_Height
(rast)
返回栅格的高度(以像素为单位)。 |
ST_IsEmpty
(rast)
如果栅格为空(宽度 = 0 且高度 = 0),则返回 true。 否则,返回 false。 |
ST_MemSize
(rast)
返回栅格占用的空间量(以字节为单位)。 |
ST_MetaData
(rast)
返回有关栅格对象的基本元数据,例如像素大小、旋转(倾斜)、左上、左下等。 |
ST_NumBands
(rast)
返回栅格对象中的波段数。 |
ST_PixelHeight
(rast)
返回空间参考系统的几何单位的像素高度。 |
ST_PixelWidth
(rast)
返回空间参考系统的几何单位的像素宽度。 |
ST_ScaleX
(rast)
返回像素宽度的 X 分量(以坐标参考系为单位)。 |
ST_ScaleY
(rast)
返回像素高度的 Y 分量(以坐标参考系为单位)。 |
ST_RasterToWorldCoord
(rast, xcolumn, yrow)
在给定列和行的情况下,以几何 X 和 Y(经度和纬度)形式返回栅格的左上角。 列和行从 1 开始。 |
ST_RasterToWorldCoordX
返回栅格、列和行左上角的几何 X 坐标。 列和行的编号从 1 开始。
- rast, xcolumn
- rast, xcolumn, yrow
|
ST_RasterToWorldCoordY
返回栅格、列和行的左上角的几何 Y 坐标。 列和行的编号从 1 开始。
- rast, yrow
- rast, xcolumn, yrow
|
ST_Rotation
(rast)
返回栅格的旋转弧度。 |
ST_SkewX
(rast)
返回地理参考 X 倾斜(或旋转参数)。 |
ST_SkewY
(rast)
返回地理参考 Y 倾斜(或旋转参数)。 |
ST_SRID
(rast)
返回在spatial_ref_sys表中定义的栅格的空间参考标识符。 |
ST_Summary
(rast)
返回栅格内容的文本摘要。 |
ST_UpperLeftX
(rast)
返回投影空间参考中栅格的左上角 X 坐标。 |
ST_UpperLeftY
(rast)
返回投影空间参考中栅格的左上角 Y 坐标。 |
ST_Width
(rast)
返回栅格的宽度(以像素为单位)。 |
ST_WorldToRasterCoord
给定几何 X 和 Y(经度和纬度)或以栅格的空间参考坐标系表示的点几何,将左上角作为列和行返回。
- rast, pt
- rast, longitude, latitude
|
ST_WorldToRasterCoordX
返回栅格中点几何 (pt) 的列或以栅格世界空间参考系表示的 X 和 Y 世界坐标 (xw, yw)。
- rast, pt
- rast, xw
- rast, xw, yw
|
ST_WorldToRasterCoordY
返回点几何图形 (pt) 的栅格中的行或以栅格的世界空间参考系表示的 X 和 Y 世界坐标 (xw, yw)。
- rast, pt
- rast, xw
- rast, xw, yw
|
栅格像素访问器和设置器 |
ST_PixelAsPolygon
(rast, columnx, rowy)
返回限定特定行和列的像素的多边形几何形状。 |
ST_PixelAsPolygons
(rast, band=1, exclude_nodata_value=TRUE)
返回包围栅格带的每个像素的多边形几何图形以及每个像素的值、X 和 Y 栅格坐标。 |
ST_PixelAsPoint
(rast, columnx, rowy)
返回像素左上角的点几何形状。 |
ST_PixelAsPoints
(rast, band=1, exclude_nodata_value=TRUE)
返回栅格波段的每个像素的点几何图形以及每个像素的值、X 和 Y 栅格坐标。 点几何的坐标是像素的左上角。 |
ST_PixelAsCentroid
(rast, x, y)
返回像素表示的区域的质心(点几何)。 |
ST_PixelAsCentroids
(rast, band=1, exclude_nodata_value=TRUE)
返回栅格波段的每个像素的质心(点几何)以及每个像素的值、X 和 Y 栅格坐标。 点几何是像素表示的区域的质心。 |
ST_Value
返回指定列 x、行 y 像素或特定几何点处给定波段的值。波段编号从 1 开始,如果未指定,则默认为 1。如果将参数 exclude_nodata_value 设置为 false,则所有像素都被认为与 nodata 像素相交并返回其值。如果未传递参数 exclude_nodata_value,则从栅格的元数据中读取该值。
- rast, pt, exclude_nodata_value=true
- rast, band, pt, exclude_nodata_value=true, resample='nearest'
- rast, x, y, exclude_nodata_value=true
- rast, band, x, y, exclude_nodata_value=true
|
ST_NearestValue
返回由 columnx 和 rowy 指定的给定带像素的最接近的非 NODATA 值或以与栅格相同的空间参考坐标系表示的几何点。
- rast, bandnum, pt, exclude_nodata_value=true
- rast, pt, exclude_nodata_value=true
- rast, bandnum, columnx, rowy, exclude_nodata_value=true
- rast, columnx, rowy, exclude_nodata_value=true
|
ST_SetZ
(rast, geom, resample=nearest, band=1)
返回与输入几何图形具有相同 X/Y 坐标的几何图形,并使用请求的重采样算法将栅格中的值复制到 Z 维度。 |
ST_SetM
(rast, geom, resample=nearest, band=1)
返回与输入几何图形具有相同 X/Y 坐标的几何图形,并使用请求的重采样算法将栅格中的值复制到 M 维度。 |
ST_Neighborhood
返回给定波段像素周围非 NODATA 值的二维双精度数组,该给定波段像素由 columnX 和 rowY 或以与栅格相同的空间参考坐标系表示的几何点指定。
- rast, bandnum, columnX, rowY, distanceX, distanceY, exclude_nodata_value=true
- rast, columnX, rowY, distanceX, distanceY, exclude_nodata_value=true
- rast, bandnum, pt, distanceX, distanceY, exclude_nodata_value=true
- rast, pt, distanceX, distanceY, exclude_nodata_value=true
|
ST_SetValue
返回修改后的栅格,其结果是将给定波段中的值设置为指定列x、行y像素或与特定几何图形相交的像素。波段编号从1开始,如果未指定波段,则默认为1。
- rast, bandnum, geom, newvalue
- rast, geom, newvalue
- rast, bandnum, columnx, rowy, newvalue
- rast, columnx, rowy, newvalue
|
ST_SetValues
返回通过设置给定波段的值而产生的修改后的栅格。
- rast, nband, columnx, rowy, newvalueset, noset=NULL, keepnodata=FALSE
- rast, nband, columnx, rowy, newvalueset, nosetvalue, keepnodata=FALSE
- rast, nband, columnx, rowy, width, height, newvalue, keepnodata=FALSE
- rast, columnx, rowy, width, height, newvalue, keepnodata=FALSE
- rast, nband, geomvalset, keepnodata=FALSE
|
ST_DumpValues
获取指定 band(波段) 的值作为二维数组。
- rast, nband=NULL, exclude_nodata_value=true
- rast, nband, exclude_nodata_value=true
|
ST_PixelOfValue
获取值等于搜索值的像素的列x、行y坐标。
- rast, nband, search, exclude_nodata_value=true
- rast, search, exclude_nodata_value=true
- rast, nband, search, exclude_nodata_value=true
- rast, search, exclude_nodata_value=true
|
栅格编辑器 |
ST_SetGeoReference
Set Georeference 6 georeference parameters in a single call. Numbers should be separated by white space. Accepts inputs in GDAL or ESRI format. Default is GDAL.
- rast, georefcoords, format=GDAL
- rast, upperleftx, upperlefty, scalex, scaley, skewx, skewy
|
ST_SetRotation
(rast, rotation)
Set the rotation of the raster in radian. |
ST_SetScale
Sets the X and Y size of pixels in units of coordinate reference system. Number units/pixel width/height.
- rast, xy
- rast, x, y
|
ST_SetSkew
Sets the georeference X and Y skew (or rotation parameter). If only one is passed in, sets X and Y to the same value.
- rast, skewxy
- rast, skewx, skewy
|
ST_SetSRID
(rast, srid)
Sets the SRID of a raster to a particular integer srid defined in the spatial_ref_sys table. |
ST_SetUpperLeft
(rast, x, y)
Sets the value of the upper left corner of the pixel of the raster to projected X and Y coordinates. |
ST_Resample
Resample a raster using a specified resampling algorithm, new dimensions, an arbitrary grid corner and a set of raster georeferencing attributes defined or borrowed from another raster.
- rast, width, height, gridx=NULL, gridy=NULL, skewx=0, skewy=0, algorithm=NearestNeighbor, maxerr=0.125
- rast, scalex=0, scaley=0, gridx=NULL, gridy=NULL, skewx=0, skewy=0, algorithm=NearestNeighbor, maxerr=0.125
- rast, ref, algorithm=NearestNeighbor, maxerr=0.125, usescale=true
- rast, ref, usescale, algorithm=NearestNeighbor, maxerr=0.125
|
ST_Rescale
Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using the NearestNeighbor (english or american spelling), Bilinear, Cubic, CubicSpline, Lanczos, Max or Min resampling algorithm. Default is NearestNeighbor.
- rast, scalexy, algorithm=NearestNeighbor, maxerr=0.125
- rast, scalex, scaley, algorithm=NearestNeighbor, maxerr=0.125
|
ST_Reskew
Resample a raster by adjusting only its skew (or rotation parameters). New pixel values are computed using the NearestNeighbor (english or american spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. Default is NearestNeighbor.
- rast, skewxy, algorithm=NearestNeighbor, maxerr=0.125
- rast, skewx, skewy, algorithm=NearestNeighbor, maxerr=0.125
|
ST_SnapToGrid
Resample a raster by snapping it to a grid. New pixel values are computed using the NearestNeighbor (english or american spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. Default is NearestNeighbor.
- rast, gridx, gridy, algorithm=NearestNeighbor, maxerr=0.125, scalex=DEFAULT 0, scaley=DEFAULT 0
- rast, gridx, gridy, scalex, scaley, algorithm=NearestNeighbor, maxerr=0.125
- rast, gridx, gridy, scalexy, algorithm=NearestNeighbor, maxerr=0.125
|
ST_Resize
Resize a raster to a new width/height
- rast, width, height, algorithm=NearestNeighbor, maxerr=0.125
- rast, percentwidth, percentheight, algorithm=NearestNeighbor, maxerr=0.125
- rast, width, height, algorithm=NearestNeighbor, maxerr=0.125
|
ST_Transform
Reprojects a raster in a known spatial reference system to another known spatial reference system using specified resampling algorithm. Options are NearestNeighbor, Bilinear, Cubic, CubicSpline, Lanczos defaulting to NearestNeighbor.
- rast, srid, algorithm=NearestNeighbor, maxerr=0.125, scalex, scaley
- rast, srid, scalex, scaley, algorithm=NearestNeighbor, maxerr=0.125
- rast, alignto, algorithm=NearestNeighbor, maxerr=0.125
|
Raster Band Statistics and Analytics |
ST_Count
Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified defaults to band 1. If exclude_nodata_value is set to true, will only count pixels that are not equal to the nodata value.
- rast, nband=1, exclude_nodata_value=true
- rast, exclude_nodata_value
|
ST_CountAgg
Aggregate. Returns the number of pixels in a given band of a set of rasters. If no band is specified defaults to band 1. If exclude_nodata_value is set to true, will only count pixels that are not equal to the NODATA value.
- rast, nband, exclude_nodata_value, sample_percent
- rast, nband, exclude_nodata_value
- rast, exclude_nodata_value
|
ST_Histogram
Returns a set of record summarizing a raster or raster coverage data distribution separate bin ranges. Number of bins are autocomputed if not specified.
- rast, nband=1, exclude_nodata_value=true, bins=autocomputed, width=NULL, right=false
- rast, nband, bins, width=NULL, right=false
- rast, nband, exclude_nodata_value, bins, right
- rast, nband, bins, right
|
ST_Quantile
Compute quantiles for a raster or raster table coverage in the context of the sample or population. Thus, a value could be examined to be at the raster's 25%, 50%, 75% percentile.
- rast, nband=1, exclude_nodata_value=true, quantiles=NULL
- rast, quantiles
- rast, nband, quantiles
- rast, quantile
- rast, exclude_nodata_value, quantile=NULL
- rast, nband, quantile
- rast, nband, exclude_nodata_value, quantile
- rast, nband, quantile
|
ST_SummaryStats
Returns summarystats consisting of count, sum, mean, stddev, min, max for a given raster band of a raster or raster coverage. Band 1 is assumed is no band is specified.
- rast, exclude_nodata_value
- rast, nband, exclude_nodata_value
|
ST_SummaryStatsAgg
Aggregate. Returns summarystats consisting of count, sum, mean, stddev, min, max for a given raster band of a set of raster. Band 1 is assumed is no band is specified.
- rast, nband, exclude_nodata_value, sample_percent
- rast, exclude_nodata_value, sample_percent
- rast, nband, exclude_nodata_value
|
ST_ValueCount
Returns a set of records containing a pixel band value and count of the number of pixels in a given band of a raster (or a raster coverage) that have a given set of values. If no band is specified defaults to band 1. By default nodata value pixels are not counted. and all other values in the pixel are output and pixel band values are rounded to the nearest integer.
- rast, nband=1, exclude_nodata_value=true, searchvalues=NULL, roundto=0,
- rast, nband, searchvalues, roundto=0,
- rast, searchvalues, roundto=0,
- rast, searchvalue, roundto=0
- rast, nband, exclude_nodata_value, searchvalue, roundto=0
- rast, nband, searchvalue, roundto=0
- rastertable, rastercolumn, nband=1, exclude_nodata_value=true, searchvalues=NULL, roundto=0,
- rastertable, rastercolumn, searchvalues, roundto=0,
- rastertable, rastercolumn, nband, searchvalues, roundto=0,
- rastertable, rastercolumn, nband, exclude_nodata_value, searchvalue, roundto=0
- rastertable, rastercolumn, searchvalue, roundto=0
- rastertable, rastercolumn, nband, searchvalue, roundto=0
|
Raster Outputs |
ST_AsBinary/ST_AsWKB
Return the Well-Known Binary (WKB) representation of the raster.
- rast, outasin=FALSE
- rast, outasin=FALSE
|
ST_AsHexWKB
(rast, outasin=FALSE)
Return the Well-Known Binary (WKB) in Hex representation of the raster. |
ST_AsGDALRaster
(rast, format, options=NULL, srid=sameassource)
Return the raster tile in the designated GDAL Raster format. Raster formats are one of those supported by your compiled library. Use ST_GDALDrivers() to get a list of formats supported by your library. |
ST_AsJPEG
Return the raster tile selected bands as a single Joint Photographic Exports Group (JPEG) image (byte array). If no band is specified and 1 or more than 3 bands, then only the first band is used. If only 3 bands then all 3 bands are used and mapped to RGB.
- rast, options=NULL
- rast, nband, quality
- rast, nband, options=NULL
- rast, nbands, options=NULL
- rast, nbands, quality
|
ST_AsPNG
Return the raster tile selected bands as a single portable network graphics (PNG) image (byte array). If 1, 3, or 4 bands in raster and no bands are specified, then all bands are used. If more 2 or more than 4 bands and no bands specified, then only band 1 is used. Bands are mapped to RGB or RGBA space.
- rast, options=NULL
- rast, nband, compression
- rast, nband, options=NULL
- rast, nbands, compression
- rast, nbands, options=NULL
|
ST_AsTIFF
Return the raster selected bands as a single TIFF image (byte array). If no band is specified or any of specified bands does not exist in the raster, then will try to use all bands.
- rast, options='', srid=sameassource
- rast, compression='', srid=sameassource
- rast, nbands, compression='', srid=sameassource
- rast, nbands, options, srid=sameassource
|
Raster Processing: Map Algebra |
ST_Clip
Returns the raster clipped by the input geometry. If band number not is specified, all bands are processed. If crop is not specified or TRUE, the output raster is cropped.
- rast, nband, geom, nodataval=NULL, crop=TRUE
- rast, nband, geom, nodataval, crop=TRUE
- rast, nband, geom, crop
- rast, geom, nodataval=NULL, crop=TRUE
- rast, geom, nodataval, crop=TRUE
- rast, geom, crop
|
ST_ColorMap
Creates a new raster of up to four 8BUI bands (grayscale, RGB, RGBA) from the source raster and a specified band. Band 1 is assumed if not specified.
- rast, nband=1, colormap=grayscale, method=INTERPOLATE
- rast, colormap, method=INTERPOLATE
|
ST_Grayscale
Creates a new one-8BUI band raster from the source raster and specified bands representing Red, Green and Blue
- rast, redband=1, greenband=2, blueband=3, extenttype=INTERSECTION
- rastbandargset, extenttype=INTERSECTION
|
ST_Intersection
Returns a raster or a set of geometry-pixelvalue pairs representing the shared portion of two rasters or the geometrical intersection of a vectorization of the raster and a geometry.
- geom, rast, band_num=1
- rast, geom
- rast, band, geomin
- rast1, rast2, nodataval
- rast1, rast2, returnband, nodataval
- rast1, band1, rast2, band2, nodataval
- rast1, band1, rast2, band2, returnband, nodataval
|
ST_MapAlgebra (callback function version)
Callback function version - Returns a one-band raster given one or more input rasters, band indexes and one user-specified callback function.
- rastbandargset, callbackfunc, pixeltype=NULL, extenttype=INTERSECTION, customextent=NULL, distancex=0, distancey=0, VARIADIC userargs=NULL
- rast, nband, callbackfunc, pixeltype=NULL, extenttype=FIRST, customextent=NULL, distancex=0, distancey=0, VARIADIC userargs=NULL
- rast, nband, callbackfunc, pixeltype=NULL, extenttype=FIRST, customextent=NULL, distancex=0, distancey=0, VARIADIC userargs=NULL
- rast1, nband1, rast2, nband2, callbackfunc, pixeltype=NULL, extenttype=INTERSECTION, customextent=NULL, distancex=0, distancey=0, VARIADIC userargs=NULL
- rast, nband, callbackfunc, mask, weighted, pixeltype=NULL, extenttype=INTERSECTION, customextent=NULL, VARIADIC userargs=NULL
|
ST_MapAlgebra (expression version)
Expression version - Returns a one-band raster given one or two input rasters, band indexes and one or more user-specified SQL expressions.
- rast, nband, pixeltype, expression, nodataval=NULL
- rast, pixeltype, expression, nodataval=NULL
- rast1, nband1, rast2, nband2, expression, pixeltype=NULL, extenttype=INTERSECTION, nodata1expr=NULL, nodata2expr=NULL, nodatanodataval=NULL
- rast1, rast2, expression, pixeltype=NULL, extenttype=INTERSECTION, nodata1expr=NULL, nodata2expr=NULL, nodatanodataval=NULL
|
ST_MapAlgebraExpr
1 raster band version: Creates a new one band raster formed by applying a valid PostgreSQL algebraic operation on the input raster band and of pixeltype provided. Band 1 is assumed if no band is specified.
- rast, band, pixeltype, expression, nodataval=NULL
- rast, pixeltype, expression, nodataval=NULL
|
ST_MapAlgebraExpr
2 raster band version: Creates a new one band raster formed by applying a valid PostgreSQL algebraic operation on the two input raster bands and of pixeltype provided. band 1 of each raster is assumed if no band numbers are specified. The resulting raster will be aligned (scale, skew and pixel corners) on the grid defined by the first raster and have its extent defined by the "extenttype" parameter. Values for "extenttype" can be: INTERSECTION, UNION, FIRST, SECOND.
- rast1, rast2, expression, pixeltype=same_as_rast1_band, extenttype=INTERSECTION, nodata1expr=NULL, nodata2expr=NULL, nodatanodataval=NULL
- rast1, band1, rast2, band2, expression, pixeltype=same_as_rast1_band, extenttype=INTERSECTION, nodata1expr=NULL, nodata2expr=NULL, nodatanodataval=NULL
|
ST_MapAlgebraFct
1 band version - Creates a new one band raster formed by applying a valid PostgreSQL function on the input raster band and of pixeltype prodived. Band 1 is assumed if no band is specified.
- rast, onerasteruserfunc
- rast, onerasteruserfunc, VARIADIC args
- rast, pixeltype, onerasteruserfunc
- rast, pixeltype, onerasteruserfunc, VARIADIC args
- rast, band, onerasteruserfunc
- rast, band, onerasteruserfunc, VARIADIC args
- rast, band, pixeltype, onerasteruserfunc
- rast, band, pixeltype, onerasteruserfunc, VARIADIC args
|
ST_MapAlgebraFct
2 band version - Creates a new one band raster formed by applying a valid PostgreSQL function on the 2 input raster bands and of pixeltype prodived. Band 1 is assumed if no band is specified. Extent type defaults to INTERSECTION if not specified.
- rast1, rast2, tworastuserfunc, pixeltype=same_as_rast1, extenttype=INTERSECTION, VARIADIC userargs
- rast1, band1, rast2, band2, tworastuserfunc, pixeltype=same_as_rast1, extenttype=INTERSECTION, VARIADIC userargs
|
ST_MapAlgebraFctNgb
(rast, band, pixeltype, ngbwidth, ngbheight, onerastngbuserfunc, nodatamode, VARIADIC args)
1-band version: Map Algebra Nearest Neighbor using user-defined PostgreSQL function. Return a raster which values are the result of a PLPGSQL user function involving a neighborhood of values from the input raster band. |
ST_Reclass
Creates a new raster composed of band types reclassified from original. The nband is the band to be changed. If nband is not specified assumed to be 1. All other bands are returned unchanged. Use case: convert a 16BUI band to a 8BUI and so forth for simpler rendering as viewable formats.
- rast, nband, reclassexpr, pixeltype, nodataval=NULL
- rast, VARIADIC reclassargset
- rast, reclassexpr, pixeltype
|
ST_Union
Returns the union of a set of raster tiles into a single raster composed of 1 or more bands.
- rast
- rast, unionargset
- rast, nband
- rast, uniontype
- rast, nband, uniontype
|
Built-in Map Algebra Callback Functions |
ST_Distinct4ma
Raster processing function that calculates the number of unique pixel values in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_InvDistWeight4ma
(value, pos, VARIADIC userargs)
Raster processing function that interpolates a pixel's value from the pixel's neighborhood. |
ST_Max4ma
Raster processing function that calculates the maximum pixel value in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Mean4ma
Raster processing function that calculates the mean pixel value in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Min4ma
Raster processing function that calculates the minimum pixel value in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_MinDist4ma
(value, pos, VARIADIC userargs)
Raster processing function that returns the minimum distance (in number of pixels) between the pixel of interest and a neighboring pixel with value. |
ST_Range4ma
Raster processing function that calculates the range of pixel values in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_StdDev4ma
Raster processing function that calculates the standard deviation of pixel values in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Sum4ma
Raster processing function that calculates the sum of all pixel values in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
Raster Processing: DEM (Elevation) |
ST_Aspect
Returns the aspect (in degrees by default) of an elevation raster band. Useful for analyzing terrain.
- rast, band=1, pixeltype=32BF, units=DEGREES, interpolate_nodata=FALSE
- rast, band, customextent, pixeltype=32BF, units=DEGREES, interpolate_nodata=FALSE
|
ST_HillShade
Returns the hypothetical illumination of an elevation raster band using provided azimuth, altitude, brightness and scale inputs.
- rast, band=1, pixeltype=32BF, azimuth=315, altitude=45, max_bright=255, scale=1.0, interpolate_nodata=FALSE
- rast, band, customextent, pixeltype=32BF, azimuth=315, altitude=45, max_bright=255, scale=1.0, interpolate_nodata=FALSE
|
ST_Roughness
(rast, nband, customextent, pixeltype="32BF", interpolate_nodata=FALSE )
Returns a raster with the calculated "roughness" of a DEM. |
ST_Slope
Returns the slope (in degrees by default) of an elevation raster band. Useful for analyzing terrain.
- rast, nband=1, pixeltype=32BF, units=DEGREES, scale=1.0, interpolate_nodata=FALSE
- rast, nband, customextent, pixeltype=32BF, units=DEGREES, scale=1.0, interpolate_nodata=FALSE
|
ST_TPI
(rast, nband, customextent, pixeltype="32BF", interpolate_nodata=FALSE )
Returns a raster with the calculated Topographic Position Index. |
ST_TRI
(rast, nband, customextent, pixeltype="32BF", interpolate_nodata=FALSE )
Returns a raster with the calculated Terrain Ruggedness Index. |
Raster and Raster Band Spatial Relationships |
ST_Contains
Return true if no points of raster rastB lie in the exterior of raster rastA and at least one point of the interior of rastB lies in the interior of rastA.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_ContainsProperly
Return true if rastB intersects the interior of rastA but not the boundary or exterior of rastA.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_Covers
Return true if no points of raster rastB lie outside raster rastA.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_CoveredBy
Return true if no points of raster rastA lie outside raster rastB.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_Disjoint
Return true if raster rastA does not spatially intersect rastB.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_Intersects
Return true if raster rastA spatially intersects raster rastB.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
- rast, nband, geommin
- rast, geommin, nband=NULL
- geommin, rast, nband=NULL
|
ST_Overlaps
Return true if raster rastA and rastB intersect but one does not completely contain the other.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_Touches
Return true if raster rastA and rastB have at least one point in common but their interiors do not intersect.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_SameAlignment
Returns true if rasters have same skew, scale, spatial ref, and offset (pixels can be put on same grid without cutting into pixels) and false if they don't with notice detailing issue.
- rastA, rastB
- ulx1, uly1, scalex1, scaley1, skewx1, skewy1, ulx2, uly2, scalex2, scaley2, skewx2, skewy2
- rastfield agg
|
ST_NotSameAlignmentReason
(rastA, rastB)
Returns text stating if rasters are aligned and if not aligned, a reason why. |
ST_Within
Return true if no points of raster rastA lie in the exterior of raster rastB and at least one point of the interior of rastA lies in the interior of rastB.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_DWithin
Return true if rasters rastA and rastB are within the specified distance of each other.
- rastA, nbandA, rastB, nbandB, distance_of_srid
- rastA, rastB, distance_of_srid
|
ST_DFullyWithin
Return true if rasters rastA and rastB are fully within the specified distance of each other.
- rastA, nbandA, rastB, nbandB, distance_of_srid
- rastA, rastB, distance_of_srid
|