ST_ConvexHull — 返回栅格的凸壳几何图形,包括等于BandNoDataValue的像素值。对于形状规则且无倾斜的栅格,这将提供与ST_Entaine相同的结果,因此仅适用于形状不规则或倾斜的栅格。
geometry
ST_ConvexHull
(
raster
rast
)
;
返回包含NoDataBandValue波段像素的栅格凸壳几何图形。对于形状规则且无倾斜的栅格,这会产生与ST_Entaine大致相同的结果,因此仅适用于形状不规则或倾斜的栅格。
![]() |
|
ST_Entaine填充坐标,因此在栅格周围添加一些缓冲区,因此答案与ST_ConvexHull略有不同,ST_ConvexHull不填充。 |
请参阅 PostGIS栅格规范 以获得这方面的图表。
-- Note envelope and convexhull are more or less the same
SELECT ST_AsText(ST_ConvexHull(rast)) As convhull,
ST_AsText(ST_Envelope(rast)) As env
FROM dummy_rast WHERE rid=1;
convhull | env
--------------------------------------------------------+------------------------------------
POLYGON((0.5 0.5,20.5 0.5,20.5 60.5,0.5 60.5,0.5 0.5)) | POLYGON((0 0,20 0,20 60,0 60,0 0))
-- now we skew the raster
-- note how the convex hull and envelope are now different
SELECT ST_AsText(ST_ConvexHull(rast)) As convhull,
ST_AsText(ST_Envelope(rast)) As env
FROM (SELECT ST_SetRotation(rast, 0.1, 0.1) As rast
FROM dummy_rast WHERE rid=1) As foo;
convhull | env
--------------------------------------------------------+------------------------------------
POLYGON((0.5 0.5,20.5 1.5,22.5 61.5,2.5 60.5,0.5 0.5)) | POLYGON((0 0,22 0,22 61,0 61,0 0))