1、st_dwitnin 比st_distance速度快,需要在geometry字段上创建gist索引
SELECT the_geom
FROM geom_table
WHERE ST_Distance(the_geom, ‘SRID=312;POINT(100000 200000)’) < 100
SELECT the_geom
FROM geom_table
WHERE ST_DWithin(the_geom, ‘SRID=312;POINT(100000 200000)’, 100)
2、AddGeometryColumn
– Add a spatial column to the table
SELECT AddGeometryColumn (‘my_schema’,‘my_spatial_table’,‘geom’,4326,‘POINT’,2);
3、st_intersects
判断两个feature是否相交返回bool值
4、st_intersection
返回相交的geometry
5、st_astext
转换geometry为text
6、st_geomfromtext(‘POINT(30 120)’,4326)
如上,给定text,创建geometry
7、st_area、st_length
求面积,长度
8、st_union
geometry合并
9、postgis geometry与arcgis geometry互相转换
第一步:postgis》》gis
IGeometryFactory3 factory = new GeometryEnvironment() as IGeometryFactory3;
factory.CreateGeometryFromWkbVariant(wkb, out geom, out countin);
第二步:gis》》postgis
IGeometryFactory3 factory = new GeometryEnvironment() as IGeometryFactory3;
byte[] geoBytes = factory.CreateWkbVariantFromGeometry(geometry) as byte[];
拼接SQL时要将上面的byte[]数组转码
其实postgis处理存到pg中的是一长串的16进制字符串,相信大家打开数据库能看到,要想拼接好SQL串就得这样来一下:st_geometryfromwkb(decode(’" + geoByteStr + "’, ‘hex’))其中的geoByteStr是byte[]转成16进制的字串
10、DropGeometryTable
SELECT DropGeometryTable (‘my_schema’,‘my_spatial_table’);
----RESULT output —
my_schema.my_spatial_table dropped.
– The above is now equivalent to –
DROP TABLE my_schema.my_spatial_table;
11、SELECT PostGIS_Extensions_Upgrade();
将postgresql安装的扩展进行更新,更新到最新版本
• ST_3DExtent - an aggregate function that returns the box3D bounding box that bounds rows of geometries.
• ST_Accum - Aggregate. Constructs an array of geometries.
• ST_AsGeobuf - Return a Geobuf representation of a set of rows.
• ST_AsMVT - Return a Mapbox Vector Tile representation of a set of rows.
• ST_ClusterIntersecting - Aggregate. Returns an array with the connected components of a set of geometries
• ST_ClusterWithin - Aggregate. Returns an array of GeometryCollections, where each GeometryCollection represents a set of
geometries separated by no more than the specified distance.
• ST_Collect - Return a specified ST_Geometry value from a collection of other geometries.
• ST_Extent - an aggregate function that returns the bounding box that bounds rows of geometries.
• ST_MakeLine - Creates a Linestring from point, multipoint, or line geometries.
• ST_MemUnion - Same as ST_Union, only memory-friendly (uses less memory and more processor time).
• ST_Polygonize - Aggregate. Creates a GeometryCollection containing possible polygons formed from the constituent linework
of a set of geometries.
• 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.
• ST_Union - Returns a geometry that represents the point set union of the Geometries.
• TopoElementArray_Agg - Returns a topoelementarray for a set of element_id, type arrays (topoelements)
• ST_Area - Returns the area of the surface if it is a Polygon or MultiPolygon. For geometry, a 2D Cartesian area is determined
with units specified by the SRID. For geography, area is determined on a curved surface with units in square meters. This
method implements the SQL/MM specification. SQL-MM 3: 8.1.2, 9.5.3
• ST_AsBinary - Return the Well-Known Binary (WKB) representation of the geometry/geography without SRID meta data.
This method implements the SQL/MM specification. SQL-MM 3: 5.1.37
• ST_AsText - Return the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata. This
method implements the SQL/MM specification. SQL-MM 3: 5.1.25
• ST_Boundary - Returns the closure of the combinatorial boundary of this Geometry. This method implements the SQL/MM
specification. SQL-MM 3: 5.1.14
• ST_Buffer - (T)Returns a geometry covering all points within a given distancefrom the input geometry. This method implements
the SQL/MM specification. SQL-MM 3: 5.1.17
• ST_Centroid - Returns the geometric center of a geometry. This method implements the SQL/MM specification.
• ST_Contains - Returns true if and only if no points of B lie in the exterior of A, and at least one point of the interior of B lies
in the interior of A. This method implements the SQL/MM specification. SQL-MM 3: 5.1.31
• ST_Crosses - Returns TRUE if the supplied geometries have some, but not all, interior points in common. This method
implements the SQL/MM specification. SQL-MM 3: 5.1.29
• ST_Difference - Returns a geometry that represents that part of geometry A that does not intersect with geometry B. This
method implements the SQL/MM specification. SQL-MM 3: 5.1.20
• ST_Dimension - The inherent dimension of this Geometry object, which must be less than or equal to the coordinate dimension.
This method implements the SQL/MM specification. SQL-MM 3: 5.1.2
• ST_Disjoint - Returns TRUE if the Geometries do not “spatially intersect” - if they do not share any space together. This
method implements the SQL/MM specification. SQL-MM 3: 5.1.26
• ST_Distance - For geometry type returns the 2D Cartesian distance between two geometries in projected units (based on spatial
reference system). For geography type defaults to return minimum geodesic distance between two geographies in meters. This
method implements the SQL/MM specification. SQL-MM 3: 5.1.23
• ST_EndPoint - Returns the last point of a LINESTRING or CIRCULARLINESTRING geometry as a POINT. This method
implements the SQL/MM specification. SQL-MM 3: 7.1.4
• ST_Envelope - Returns a geometry representing the double precision (float8) bounding box of the supplied geometry. This
method implements the SQL/MM specification. SQL-MM 3: 5.1.15
• ST_Equals - Returns true if the given geometries represent the same geometry. Directionality is ignored. This method implements
the SQL/MM specification. SQL-MM 3: 5.1.24
• ST_ExteriorRing - Returns a line string representing the exterior ring of the POLYGON geometry. Return NULL if the
geometry is not a polygon. Will not work with MULTIPOLYGON This method implements the SQL/MM specification.
• ST_GeomFromText - Return a specified ST_Geometry value from Well-Known Text representation (WKT). This method
implements the SQL/MM specification. SQL-MM 3: 5.1.40
• ST_GeomFromWKB - Creates a geometry instance from a Well-Known Binary geometry representation (WKB) and optional
SRID. This method implements the SQL/MM specification. SQL-MM 3: 5.1.41
• ST_GeometryFromText - Return a specified ST_Geometry value from Well-Known Text representation (WKT). This is an
alias name for ST_GeomFromText This method implements the SQL/MM specification. SQL-MM 3: 5.1.40
• ST_GetFaceEdges - Returns a set of ordered edges that bound aface. This method implements the SQL/MM specification.
SQL-MM 3 Topo-Geo and Topo-Net 3: Routine Details: X.3.5
PostGIS 2.5.3dev Manual 739 / 846
• ST_GetFaceGeometry - Returns the polygon in the given topology with the specified face id. This method implements the
SQL/MM specification. SQL-MM 3 Topo-Geo and Topo-Net 3: Routine Details: X.3.16
• ST_InitTopoGeo - Creates a new topology schema and registers this new schema in the topology.topology table and details
summary of process. This method implements the SQL/MM specification. SQL-MM 3 Topo-Geo and Topo-Net 3: Routine
Details: X.3.17
• ST_InteriorRingN - Return the Nth interior linestring ring of the polygon geometry. Return NULL if the geometry is not a
polygon or the given N is out of range. This method implements the SQL/MM specification. SQL-MM 3: 8.2.6, 8.3.5
• ST_Intersection - (T)Returns a geometry that represents the shared portion of geomA and geomB. This method implements
the SQL/MM specification. SQL-MM 3: 5.1.18
• ST_Intersects - Returns TRUE if the Geometries/Geography “spatially intersect in 2D” - (share any portion of space) and
FALSE if they don’t (they are Disjoint). For geography – tolerance is 0.00001 meters (so any points that close are considered
to intersect) This method implements the SQL/MM specification. SQL-MM 3: 5.1.27
• ST_IsClosed - Returns TRUE if the LINESTRING’s start and end points are coincident. For Polyhedral surface is closed
(volumetric). This method implements the SQL/MM specification. SQL-MM 3: 7.1.5, 9.3.3
• ST_IsEmpty - Returns true if this Geometry is an empty geometrycollection, polygon, point etc. This method implements the
SQL/MM specification. SQL-MM 3: 5.1.7
• ST_IsRing - Returns TRUE if this LINESTRING is both closed and simple. This method implements the SQL/MM specification.
SQL-MM 3: 7.1.6
• ST_IsSimple - Returns (TRUE) if this Geometry has no anomalous geometric points, such as self intersection or self tangency.
This method implements the SQL/MM specification. SQL-MM 3: 5.1.8
• ST_IsValid - Returns true if the ST_Geometry is well formed. This method implements the SQL/MM specification. SQL-MM
3: 5.1.9
• ST_Length - Returns the 2D length of the geometry if it is a LineString or MultiLineString. geometry are in units of spatial
reference and geography are in meters (default spheroid) This method implements the SQL/MM specification. SQL-MM 3:
7.1.2, 9.3.4
• ST_LineFromText - Makes a Geometry from WKT representation with the given SRID. If SRID is not given, it defaults to 0.
This method implements the SQL/MM specification. SQL-MM 3: 7.2.8
• ST_LineFromWKB - Makes a LINESTRING from WKB with the given SRID This method implements the SQL/MM specification.
SQL-MM 3: 7.2.9
• ST_LinestringFromWKB - Makes a geometry from WKB with the given SRID. This method implements the SQL/MM specification.
SQL-MM 3: 7.2.9
• ST_M - Return the M coordinate of the point, or NULL if not available. Input must be a point. This method implements the
SQL/MM specification.
• ST_MLineFromText - Return a specified ST_MultiLineString value from WKT representation. This method implements the
SQL/MM specification.SQL-MM 3: 9.4.4
• ST_MPointFromText - Makes a Geometry from WKT with the given SRID. If SRID is not given, it defaults to 0. This method
implements the SQL/MM specification. SQL-MM 3: 9.2.4
• ST_MPolyFromText - Makes a MultiPolygon Geometry from WKT with the given SRID. If SRID is not given, it defaults to
0. This method implements the SQL/MM specification. SQL-MM 3: 9.6.4
• ST_ModEdgeHeal - Heal two edges by deleting the node connecting them, modifying the first edgeand deleting the second
edge. Returns the id of the deleted node. This method implements the SQL/MM specification. SQL-MM: Topo-Geo and
Topo-Net 3: Routine Details: X.3.9
• ST_ModEdgeSplit - Split an edge by creating a new node along an existing edge, modifying the original edge and adding a
new edge. This method implements the SQL/MM specification. SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X.3.9
PostGIS 2.5.3dev Manual 740 / 846
• ST_MoveIsoNode - Moves an isolated node in a topology from one point to another. If new apoint geometry exists as a node
an error is thrown. Returns description of move. This method implements the SQL/MM specification. SQL-MM: Topo-Net
Routines: X.3.2
• ST_NewEdgeHeal - Heal two edges by deleting the node connecting them, deleting both edges,and replacing them with an
edge whose direction is the same as the firstedge provided. This method implements the SQL/MM specification. SQL-MM:
Topo-Geo and Topo-Net 3: Routine Details: X.3.9
• ST_NewEdgesSplit - Split an edge by creating a new node along an existing edge, deleting the original edge and replacing it
with two new edges. Returns the id of the new node created that joins the new edges. This method implements the SQL/MM
specification. SQL-MM: Topo-Net Routines: X.3.8
• ST_NumGeometries - If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the number of geometries, for single
geometries will return 1, otherwise return NULL. This method implements the SQL/MM specification. SQL-MM 3: 9.1.4
• ST_NumInteriorRings - Return the number of interior rings of a polygon geometry. This method implements the SQL/MM
specification. SQL-MM 3: 8.2.5
• ST_NumPatches - Return the number of faces on a Polyhedral Surface. Will return null for non-polyhedral geometries. This
method implements the SQL/MM specification. SQL-MM 3: ?
• ST_NumPoints - Return the number of points in an ST_LineString or ST_CircularString value. This method implements the
SQL/MM specification. SQL-MM 3: 7.2.4
• ST_OrderingEquals - Returns true if the given geometries represent the same geometry and points are in the same directional
order. This method implements the SQL/MM specification. SQL-MM 3: 5.1.43
• ST_Overlaps - Returns TRUE if the Geometries share space, are of the same dimension, but are not completely contained by
each other. This method implements the SQL/MM specification. SQL-MM 3: 5.1.32
• ST_PatchN - Return the 1-based Nth geometry (face) if the geometry is a POLYHEDRALSURFACE, POLYHEDRALSURFACEM.
Otherwise, return NULL. This method implements the SQL/MM specification. SQL-MM 3: ?
• ST_Perimeter - Return the length measurement of the boundary of an ST_Surface or ST_MultiSurface geometry or geography.
(Polygon, MultiPolygon). geometry measurement is in units of spatial reference and geography is in meters. This method
implements the SQL/MM specification. SQL-MM 3: 8.1.3, 9.5.4
• ST_Point - Returns an ST_Point with the given coordinate values. OGC alias for ST_MakePoint. This method implements the
SQL/MM specification. SQL-MM 3: 6.1.2
• ST_PointFromText - Makes a point Geometry from WKT with the given SRID. If SRID is not given, it defaults to unknown.
This method implements the SQL/MM specification. SQL-MM 3: 6.1.8
• ST_PointFromWKB - Makes a geometry from WKB with the given SRID This method implements the SQL/MM specification.
SQL-MM 3: 6.1.9
• ST_PointN - Return the Nth point in the first LineString or circular LineString in the geometry. Negative values are counted
backwards from the end of the LineString. Returns NULL if there is no linestring in the geometry. This method implements
the SQL/MM specification. SQL-MM 3: 7.2.5, 7.3.5
• ST_PointOnSurface - Returns a POINT guaranteed to lie on the surface. This method implements the SQL/MM specification.
SQL-MM 3: 8.1.5, 9.5.6. According to the specs, ST_PointOnSurface works for surface geometries (POLYGONs,
MULTIPOLYGONS, CURVED POLYGONS). So PostGIS seems to be extending what the spec allows here. Most databases
Oracle,DB II, ESRI SDE seem to only support this function for surfaces. SQL Server 2008 like PostGIS supports for all
common geometries.
• ST_Polygon - Returns a polygon built from the specified linestring and SRID. This method implements the SQL/MM specification.
SQL-MM 3: 8.3.2
• ST_PolygonFromText - Makes a Geometry from WKT with the given SRID. If SRID is not given, it defaults to 0. This method
implements the SQL/MM specification. SQL-MM 3: 8.3.6
PostGIS 2.5.3dev Manual 741 / 846
• ST_Relate - Returns true if this Geometry is spatially related to anotherGeometry, by testing for intersections between the
Interior, Boundary and Exterior of the two geometries as specified by the values in the intersectionMatrixPattern. If no intersectionMatrixPattern
is passed in, then returns the maximum intersectionMatrixPattern that relates the 2 geometries. This
method implements the SQL/MM specification. SQL-MM 3: 5.1.25
• ST_RemEdgeModFace - Removes an edge and, if the removed edge separated two faces,delete one of the them and modify
the other to take the space of both. This method implements the SQL/MM specification. SQL-MM: Topo-Geo and Topo-Net
3: Routine Details: X.3.15
• ST_RemEdgeNewFace - Removes an edge and, if the removed edge separated two faces,delete the original faces and replace
them with a new face. This method implements the SQL/MM specification. SQL-MM: Topo-Geo and Topo-Net 3: Routine
Details: X.3.14
• ST_RemoveIsoEdge - Removes an isolated edge and returns description of action. If the edge is not isolated, then an exception
is thrown. This method implements the SQL/MM specification. SQL-MM: Topo-Geo and Topo-Net 3: Routine Details:
X+1.3.3
• ST_RemoveIsoNode - Removes an isolated node and returns description of action. If the node is not isolated (is start or end
of an edge), then an exception is thrown. This method implements the SQL/MM specification. SQL-MM: Topo-Geo and
Topo-Net 3: Routine Details: X+1.3.3
• ST_SRID - Returns the spatial reference identifier for the ST_Geometry as defined in spatial_ref_sys table. This method
implements the SQL/MM specification. SQL-MM 3: 5.1.5
• ST_StartPoint - Returns the first point of a LINESTRING geometry as a POINT. This method implements the SQL/MM
specification. SQL-MM 3: 7.1.3
• ST_SymDifference - Returns a geometry that represents the portions of A and B that do not intersect. It is called a symmetric
difference because ST_SymDifference(A,B) = ST_SymDifference(B,A). This method implements the SQL/MM specification.
SQL-MM 3: 5.1.21
• ST_Touches - Returns TRUE if the geometries have at least one point in common, but their interiors do not intersect. This
method implements the SQL/MM specification. SQL-MM 3: 5.1.28
• ST_Transform - Return a new geometry with its coordinates transformed to a different spatial reference. This method implements
the SQL/MM specification. SQL-MM 3: 5.1.6
• ST_Union - Returns a geometry that represents the point set union of the Geometries. This method implements the SQL/MM
specification. SQL-MM 3: 5.1.19 the z-index (elevation) when polygons are involved.
• ST_WKBToSQL - Return a specified ST_Geometry value from Well-Known Binary representation (WKB). This is an alias
name for ST_GeomFromWKB that takes no srid This method implements the SQL/MM specification. SQL-MM 3: 5.1.36
• ST_WKTToSQL - Return a specified ST_Geometry value fromWell-Known Text representation (WKT). This is an alias name
for ST_GeomFromText This method implements the SQL/MM specification. SQL-MM 3: 5.1.34
• ST_Within - Returns true if the geometry A is completely inside geometry B This method implements the SQL/MM specification.
SQL-MM 3: 5.1.30
• ST_X - Return the X coordinate of the point, or NULL if not available. Input must be a point. This method implements the
SQL/MM specification. SQL-MM 3: 6.1.3
• ST_Y - Return the Y coordinate of the point, or NULL if not available. Input must be a point. This method implements the
SQL/MM specification. SQL-MM 3: 6.1.4
• ST_Z - Return the Z coordinate of the point, or NULL if not available. Input must be a point. This method implements the
SQL/MM specification.
PostGIS 2.5.3dev Manual 742 / 846
14.4 PostGIS Geography Support Functions
The functions and operators given below are PostGIS functions/operators that take as input or return as output a geography data
type object.
Note
Functions with a (T) are not native geodetic functions, and use a ST_Transform call to and from geometry to do the
operation. As a result, they may not behave as expected when going over dateline, poles, and for large geometries or
geometry pairs that cover more than one UTM zone. Basic transform - (favoring UTM, Lambert Azimuthal (North/South),
and falling back on mercator in worst case scenario)
• ST_Area - Returns the area of the surface if it is a Polygon or MultiPolygon. For geometry, a 2D Cartesian area is determined
with units specified by the SRID. For geography, area is determined on a curved surface with units in square meters.
• ST_AsBinary - Return the Well-Known Binary (WKB) representation of the geometry/geography without SRID meta data.
• ST_AsEWKT - Return the Well-Known Text (WKT) representation of the geometry with SRID meta data.
• ST_AsGML - Return the geometry as a GML version 2 or 3 element.
• ST_AsGeoJSON - Return the geometry as a GeoJSON element.
• ST_AsKML - Return the geometry as a KML element. Several variants. Default version=2, default maxdecimaldigits=15
• ST_AsSVG - Returns a Geometry in SVG path data given a geometry or geography object.
• ST_AsText - Return the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata.
• ST_Azimuth - Returns the north-based azimuth as the angle in radians measured clockwise from the vertical on pointA to
pointB.
• ST_Buffer - (T)Returns a geometry covering all points within a given distancefrom the input geometry.
• ST_Centroid - Returns the geometric center of a geometry.
• ST_CoveredBy - Returns 1 (TRUE) if no point in Geometry/Geography A is outside Geometry/Geography B
• ST_Covers - Returns 1 (TRUE) if no point in Geometry B is outside Geometry A
• ST_DWithin - Returns true if the geometries are within the specified distance of one another. For geometry units are in those
of spatial reference and for geography units are in meters and measurement is defaulted to use_spheroid=true (measure around
spheroid), for faster check, use_spheroid=false to measure along sphere.
• ST_Distance - For geometry type returns the 2D Cartesian distance between two geometries in projected units (based on spatial
reference system). For geography type defaults to return minimum geodesic distance between two geographies in meters.
• ST_GeogFromText - Return a specified geography value from Well-Known Text representation or extended (WKT).
• ST_GeogFromWKB - Creates a geography instance from a Well-Known Binary geometry representation (WKB) or extended
Well Known Binary (EWKB).
• ST_GeographyFromText - Return a specified geography value from Well-Known Text representation or extended (WKT).
• = - Returns TRUE if the coordinates and coordinate order geometry/geography A are the same as the coordinates and coordinate
order of geometry/geography B.
• ST_Intersection - (T)Returns a geometry that represents the shared portion of geomA and geomB.
• ST_Intersects - Returns TRUE if the Geometries/Geography “spatially intersect in 2D” - (share any portion of space) and
FALSE if they don’t (they are Disjoint). For geography – tolerance is 0.00001 meters (so any points that close are considered
to intersect)
PostGIS 2.5.3dev Manual 743 / 846
• ST_Length - Returns the 2D length of the geometry if it is a LineString or MultiLineString. geometry are in units of spatial
reference and geography are in meters (default spheroid)
• ST_Perimeter - Return the length measurement of the boundary of an ST_Surface or ST_MultiSurface geometry or geography.
(Polygon, MultiPolygon). geometry measurement is in units of spatial reference and geography is in meters.
• ST_Project - Returns a POINT projected from a start point using a distance in meters and bearing (azimuth) in radians.
• ST_Segmentize - Return a modified geometry/geography having no segment longer than the given distance.
• ST_Summary - Returns a text summary of the contents of the geometry.
• <-> - Returns the 2D distance between A and B.
• && - Returns TRUE if A’s 2D bounding box intersects B’s 2D bounding box.
14.5 PostGIS Raster Support Functions
The functions and operators given below are PostGIS functions/operators that take as input or return as output a raster data type
object. Listed in alphabetical order.
• Box3D - Returns the box 3d representation of the enclosing box of the raster.
• @ - Returns TRUE if A’s bounding box is contained by B’s. Uses double precision bounding box.
• ~ - Returns TRUE if A’s bounding box is contains B’s. Uses double precision bounding box.
• = - Returns TRUE if A’s bounding box is the same as B’s. Uses double precision bounding box.
• && - Returns TRUE if A’s bounding box intersects B’s bounding box.
• &< - Returns TRUE if A’s bounding box is to the left of B’s.
• &> - Returns TRUE if A’s bounding box is to the right of B’s.
• ~= - Returns TRUE if A’s bounding box is the same as B’s.
• ST_Retile - Return a set of configured tiles from an arbitrarily tiled raster coverage.
• ST_AddBand - 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.
• ST_AsBinary/ST_AsWKB - Return the Well-Known Binary (WKB) representation of the raster.
• ST_AsGDALRaster - 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_AsHexWKB - Return the Well-Known Binary (WKB) in Hex representation of the raster.
• 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.
• 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.
• ST_AsRaster - Converts a PostGIS geometry to a PostGIS raster.
• 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.
• ST_Aspect - Returns the aspect (in degrees by default) of an elevation raster band. Useful for analyzing terrain.
PostGIS 2.5.3dev Manual 744 / 846
• ST_Band - Returns one or more bands of an existing raster as a new raster. Useful for building new rasters from existing
rasters.
• ST_BandFileSize - Returns the file size of a band stored in file system. If no bandnum specified, 1 is assumed.
• ST_BandFileTimestamp - Returns the file timestamp of a band stored in file system. If no bandnum specified, 1 is assumed.
• ST_BandIsNoData - Returns true if the band is filled with only nodata values.
• ST_BandMetaData - Returns basic meta data for a specific raster band. band num 1 is assumed if none-specified.
• ST_BandNoDataValue - Returns the value in a given band that represents no data. If no band num 1 is assumed.
• ST_BandPath - Returns system file path to a band stored in file system. If no bandnum specified, 1 is assumed.
• ST_BandPixelType - Returns the type of pixel for given band. If no bandnum specified, 1 is assumed.
• 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.
• 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.
• 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.
• ST_ContainsProperly - Return true if rastB intersects the interior of rastA but not the boundary or exterior of rastA.
• ST_ConvexHull - 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_Count - Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified defaults to band