Database Reference
In-Depth Information
record in a single column or can be split into tiles, where each tile is stored as
a separate record. Finally, ecient access to raster data requires these data
to be indexed. The RASTER type uses GIST indexes like the GEOMETRY
and GEOGRAPHY data types do. GIST indexes use the notion of minimal
bounding boxes to define indexed regions in space.
We describe next some of the functions provided by PostGIS to manipulate
raster data. For a complete description of all the functions, we refer to the
reference manual.
Several functions allow to query the properties of a raster. For example, the
function ST BandNoDataValue has as parameters a raster and a band number
and returns the value used to represent cells whose actual values are unknown,
referred to as no data. Similarly, the function ST SetBandNoDataValue sets
the value that represents no data in a band. Another function is ST Value ,
which returns the value in a location of the raster for a given band. Similarly,
the ST SetValue function returns a new raster, with the value at the specified
location set to the argument value.
Other functions convert between rasters and external data formats. For
example, the function ST AsJPEG returns selected bands of the raster as a
single JPEG image. Analogously, the functions ST AsBinary and ST AsPNG
return the binary and PNG representations of the raster, respectively.
Another group of functions converts between rasters and vector formats.
The function ST AsRaster converts a GEOMETRY to a RASTER .Toconvert
a raster to a polygon, the function ST Polygon is used, which unions all the
pixels in a raster that are not equal to the no data value of the band. The
function ST Envelope returns the minimum bounding box of the extent of the
raster, represented as a polygon.
There are functions that compare two rasters or a raster and a geometry
with respect to their spatial relation. For example, the Boolean function
ST Intersects , which takes two raster bands or a raster band and a geometry
as input, returns true if the two raster bands intersect or if the raster intersects
the geometry, respectively.
Another group of functions generates new rasters or geometries from other
ones. For example, ST Intersection takestworastersasarguments and returns
another raster. Also, the ST Union function returns the union of a set of raster
tiles into a single raster composed of one band. The extent of the resulting
raster is the extent of the whole set.
Finally, there are several aggregation functions for rasters. These include
ST Min4ma , ST Max4ma , ST Sum4ma , ST StdDev4ma ,and ST Mean4ma ,
which calculate, respectively, the minimum, maximum, sum, mean, or
standard deviation of pixel values in a neighborhood.
We finish this section by comparing the functions provided by Post-
GIS against the operations defined for the field data type introduced in
Sect. 11.1.2 .
With respect to the operations that perform the projection over domain
and range, we can see that DefSpace and ST Polygon are equivalent
 
Search WWH ::




Custom Search