ST_boundingDiagonalAsBinary

更新时间:
复制 MD 格式

Returns the well-known binary (WKB) representation of the bounding box diagonal of a pcpatch object. Use this function to pass spatial extent data to PostGIS geometry functions or client-side spatial libraries that consume WKB input. WKB preserves full numeric precision, avoiding the rounding that can occur with text-based formats.

Syntax

bytea ST_boundingDiagonalAsBinary(pcpatch pc);

Parameters

ParameterDescription
pcThe pcpatch object whose bounding box diagonal is returned.

Usage notes

The bounding box is a 2D geometry object.

Examples

SELECT ST_BoundingDiagonalAsBinary(
  ST_Patch(ARRAY[
    ST_MakePoint(1, ARRAY[0.,0.,0.,10.]),
    ST_MakePoint(1, ARRAY[1.,1.,1.,10.]),
    ST_MakePoint(1, ARRAY[10.,10.,10.,10.])
  ])
);

Result:

\x01020000a0e610000002000000000000000000000000000000000000000000000000000000000000000000244000000000000024400000000000002440