Raster Management |
AddRasterConstraints
Adds raster constraints to a loaded raster table for a specific column that constrains spatial ref, scaling, blocksize, alignment, bands, band type and a flag to denote if raster column is regularly blocked. The table must be loaded with data for the constraints to be inferred. Returns true of the constraint setting was accomplished and if issues a notice.- 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
- 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
Drops PostGIS raster constraints that refer to a raster table column. Useful if you need to reload data or update your raster column data.- 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
|
PostGIS_Raster_Lib_Build_Date
()
Reports full raster library build date.
|
PostGIS_Raster_Lib_Version
()
Reports full raster version and build configuration
infos.
|
ST_GDALDrivers
()
Returns a list of raster formats supported by your lib gdal. These are the formats you can output your raster using ST_AsGDALRaster.
|
UpdateRasterSRID1
Change the SRID of all rasters in the user-specified column and table.
- schema_name, table_name, column_name, new_srid
- table_name, column_name, new_srid
|
Raster Constructors |
ST_AddBand2
Returns a raster with the new band(s) of given type added with given initial value in the given index location. If no index is specified, the band is added to the end.
- rast, addbandargset
- rast, pixeltype, initialvalue=0, nodataval=NULL
- rast, index, pixeltype, initialvalue=0, nodataval=NULL
- torast, fromrast, fromband=1, torastindex=at_end
- torast, fromrasts, fromband=1, torastindex=at_end
|
ST_AsRaster
Converts a PostGIS geometry to a PostGIS raster.- 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
Returns one or more bands of an existing raster as a new raster. Useful for building new rasters from existing rasters.- rast, nbands = ARRAY[1]
- rast, nbands, delimiter=,
- rast, nband
|
ST_MakeEmptyRaster
Returns an empty raster (having no bands) of given dimensions (width & height), upperleft X and Y, pixel size and rotation (scalex, scaley, skewx & skewy) and reference system (srid).
If a raster is passed in, returns a new raster with the same size, alignment and SRID. If srid is left out, the spatial ref is set to unknown (0).- rast
- width, height, upperleftx, upperlefty, scalex, scaley, skewx, skewy, srid=unknown
- width, height, upperleftx, upperlefty, pixelsize
|
ST_Tile1
Returns a set of rasters resulting from the split of the input raster based upon the desired dimensions of the output rasters.- rast, nband, width, height, padwithnodata=FALSE, nodataval=NULL
- rast, nband, width, height, padwithnodata=FALSE, nodataval=NULL
- rast, width, height, padwithnodata=FALSE, nodataval=NULL
|
Raster Accessors |
ST_GeoReference
(rast, format=GDAL)
Returns the georeference meta data in GDAL or ESRI format as commonly seen in a world file. Default is GDAL.
|
ST_Height
(rast)
Returns the height of the raster in pixels.
|
ST_MetaData
(rast)
Returns basic meta data about a raster object such as pixel size, rotation (skew), upper, lower left, etc.
|
ST_NumBands
(rast)
Returns the number of bands in the raster object.
|
ST_PixelHeight
(rast)
Returns the pixel height in geometric units of the spatial reference system.
|
ST_PixelWidth
(rast)
Returns the pixel width in geometric units of the spatial reference system.
|
ST_ScaleX
(rast)
Returns the X component of the pixel width in units of coordinate reference system.
|
ST_ScaleY
(rast)
Returns the Y component of the pixel height in units of coordinate reference system.
|
ST_RasterToWorldCoord1
(rast, xcolumn, yrow)
Returns the raster's upper left corner as geometric X and Y (longitude and latitude) given a column and row. Column and row starts at 1.
|
ST_RasterToWorldCoordX
Returns the geometric X coordinate upper left of a raster, column and row. Numbering of columns
and rows starts at 1.- rast, xcolumn
- rast, xcolumn, yrow
|
ST_RasterToWorldCoordY
Returns the geometric Y coordinate upper left corner of a raster, column and row. Numbering of columns
and rows starts at 1. - rast, yrow
- rast, xcolumn, yrow
|
ST_Rotation
(rast)
Returns the rotation of the raster in radian.
|
ST_SkewX
(rast)
Returns the georeference X skew (or rotation parameter).
|
ST_SkewY
(rast)
Returns the georeference Y skew (or rotation parameter).
|
ST_SRID
(rast)
Returns the spatial reference identifier of the raster as defined in spatial_ref_sys table.
|
ST_UpperLeftX
(rast)
Returns the upper left X coordinate of raster in projected spatial ref.
|
ST_UpperLeftY
(rast)
Returns the upper left Y coordinate of raster in projected spatial ref.
|
ST_Width
(rast)
Returns the width of the raster in pixels.
|
ST_WorldToRasterCoord1
Returns the upper left corner as column and row given geometric X and Y (longitude and latitude) or a point geometry expressed in the spatial reference coordinate system of the raster.- rast, pt
- rast, longitude, latitude
|
ST_WorldToRasterCoordX
Returns the column in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw) represented
in world spatial reference system of raster.- rast, pt
- rast, xw
- rast, xw, yw
|
ST_WorldToRasterCoordY
Returns the row in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw) represented
in world spatial reference system of raster.- rast, pt
- rast, xw
- rast, xw, yw
|
ST_IsEmpty
(rast)
Returns true if the raster is empty (width = 0 and height = 0). Otherwise, returns false.
|
Raster Pixel Accessors and Setters |
ST_PixelAsPolygon
(rast, columnx, rowy)
Returns the polygon geometry that bounds the pixel for a particular row and column.
|
ST_PixelAsPolygons2
(rast, band=1, exclude_nodata_value=TRUE)
Returns the polygon geometry that bounds every pixel of a raster band along with the value, the X and the Y raster coordinates of each pixel.
|
ST_PixelAsPoint1
(rast, columnx, rowy)
Returns a point geometry of the pixel's upper-left corner.
|
ST_PixelAsPoints1
(rast, band=1, exclude_nodata_value=TRUE)
Returns a point geometry for each pixel of a raster band along with the value, the X and the Y raster coordinates of each pixel. The coordinates of the point geometry are of the pixel's upper-left corner.
|
ST_PixelAsCentroid1
(rast, columnx, rowy)
Returns the centroid (point geometry) of the area represented by a pixel.
|
ST_PixelAsCentroids1
(rast, band=1, exclude_nodata_value=TRUE)
Returns the centroid (point geometry) for each pixel of a raster band along with the value, the X and the Y raster coordinates of each pixel. The point geometry is the centroid of the area represented by a pixel.
|
ST_Value
Returns the value of a given band in a given columnx, rowy pixel or at a particular geometric point. Band numbers start at 1 and assumed to be 1 if not specified. If exclude_nodata_value is set to false, then all pixels include nodata pixels are considered to intersect and return value. If exclude_nodata_value is not passed in then reads it from metadata of raster.- rast, pt, exclude_nodata_value=true
- rast, bandnum, pt, exclude_nodata_value=true
- rast, columnx, rowy, exclude_nodata_value=true
- rast, bandnum, columnx, rowy, exclude_nodata_value=true
|
ST_NearestValue1
Returns the nearest non-NODATA value of a given band's pixel specified by a columnx and rowy or a geometric point expressed in the same spatial reference coordinate system as the raster.
- 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_Neighborhood1
Returns a 2-D double precision array of the non-NODATA values around a given band's pixel specified by either a columnX and rowY or a geometric point expressed in the same spatial reference coordinate system as the raster.
- 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_SetValue2
Returns modified raster resulting from setting the value of a given band in a given columnx, rowy pixel or the pixels that intersect a particular geometry. Band numbers start at 1 and assumed to be 1 if not specified.- rast, bandnum, geom, newvalue
- rast, geom, newvalue
- rast, bandnum, columnx, rowy, newvalue
- rast, columnx, rowy, newvalue
|
ST_SetValues1
Returns modified raster resulting from setting the values of a given band.- 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_DumpValues1
Get the values of the specified band as a 2-dimension array.
- rast, nband, exclude_nodata_value=true
- rast, nband, exclude_nodata_value=true
|
ST_PixelOfValue1
Get the columnx, rowy coordinates of the pixel whose value equals the search value.
- 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
|
Raster Editors |
ST_SetGeoReference
(rast, georefcoords, format=GDAL)
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.
|
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 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=NearestNeighbour, maxerr=0.125
- rast, scalex=0, scaley=0, gridx=NULL, gridy=NULL, skewx=0, skewy=0, algorithm=NearestNeighbor, maxerr=0.125
- rast, ref, algorithm=NearestNeighbour, maxerr=0.125, usescale=true
- rast, ref, usescale, algorithm=NearestNeighbour, 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 or Lanczos resampling algorithm. Default is NearestNeighbor.
- rast, scalexy, algorithm=NearestNeighbour, maxerr=0.125
- rast, scalex, scaley, algorithm=NearestNeighbour, 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=NearestNeighbour, maxerr=0.125
- rast, skewx, skewy, algorithm=NearestNeighbour, 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=NearestNeighbour, maxerr=0.125, scalex=DEFAULT 0, scaley=DEFAULT 0
- rast, gridx, gridy, scalex, scaley, algorithm=NearestNeighbour, maxerr=0.125
- rast, gridx, gridy, scalexy, algorithm=NearestNeighbour, maxerr=0.125
|
ST_Resize1
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_Transform2
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
- rastertable, rastercolumn, nband=1, exclude_nodata_value=true
- rastertable, rastercolumn, 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
- rastertable, rastercolumn, nband, bins, right
- rastertable, rastercolumn, nband, exclude_nodata_value, bins, right
- rastertable, rastercolumn, nband=1, exclude_nodata_value=true, bins=autocomputed, width=NULL, right=false
- rastertable, rastercolumn, nband=1, bins, width=NULL, right=false
|
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
- rastertable, rastercolumn, nband=1, exclude_nodata_value=true, quantiles=NULL
- rastertable, rastercolumn, nband, quantiles
|
ST_SummaryStats
Returns record 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.- rastertable, rastercolumn, exclude_nodata_value
- rast, exclude_nodata_value
- rastertable, rastercolumn, nband=1, exclude_nodata_value=true
- 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 Processing |
Box3D
(rast)
Returns the box 3d representation of the enclosing box of the raster.
|
ST_Clip2
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_ConvexHull
(rast)
Return the convex hull geometry of the raster including pixel values equal to BandNoDataValue.
For regular shaped and non-skewed
rasters, this gives the same result as ST_Envelope so only useful for irregularly shaped or skewed rasters.
|
ST_DumpAsPolygons
(rast, band_num=1, exclude_nodata_value=TRUE)
Returns a set of geomval (geom,val) rows, from a given raster band. If no band number is specified, band num defaults to 1.
|
ST_Envelope
(rast)
Returns the polygon representation of the extent of the raster.
|
ST_HillShade2
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_Aspect2
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_Slope2
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_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_num, geom
- rast1, rast2, nodataval
- rast1, rast2, returnband='BOTH', nodataval=NULL
- rast1, band_num1, rast2, band_num2, nodataval
- rast1, band_num1, rast2, band_num2, returnband='BOTH', nodataval=NULL
|
ST_MapAlgebra1
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
|
ST_MapAlgebra1
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_Polygon2
(rast, band_num=1)
Returns a multipolygon geometry formed by the union of pixels that have a pixel value that is not no data value. If no band number is specified, band num defaults to 1.
|
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_Union1 2
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
|
Raster Processing Builtin Functions |
ST_Min4ma2
Raster processing function that calculates the minimum pixel value in a neighborhood.
- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Max4ma2
Raster processing function that calculates the maximum pixel value in a neighborhood.- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Sum4ma2
Raster processing function that calculates the sum of all pixel values in a neighborhood.- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Mean4ma2
Raster processing function that calculates the mean pixel value in a neighborhood.- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Range4ma2
Raster processing function that calculates the range of pixel values in a neighborhood.- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_Distinct4ma2
Raster processing function that calculates the number of unique pixel values in a neighborhood.- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_StdDev4ma2
Raster processing function that calculates the standard deviation of pixel values in a neighborhood.- matrix, nodatamode, VARIADIC args
- value, pos, VARIADIC userargs
|
ST_InvDistWeight4ma1
(value, pos, VARIADIC userargs)
Raster processing function that interpolates a pixel's value from the pixel's neighborhood.
|
ST_MinDist4ma1
(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.
|
Raster and Raster Band Spatial Relationships |
ST_Contains1
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_ContainsProperly1
Return true if rastB intersects the interior of rastA but not the boundary or exterior of rastA.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_Covers1
Return true if no points of raster rastB lie outside raster rastA.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_CoveredBy1
Return true if no points of raster rastA lie outside raster rastB.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_Disjoint1
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_Overlaps1
Return true if raster rastA and rastB intersect but one does not completely contain the other.
- rastA, nbandA, rastB, nbandB
- rastA, rastB
|
ST_Touches1
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_SameAlignment2
Returns true if rasters have same skew, scale, spatial ref 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
|
ST_NotSameAlignmentReason1
(rastA, rastB)
Returns text stating if rasters are aligned and if not aligned, a reason why.
|
ST_Within1
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_DWithin1
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_DFullyWithin1
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
|