All Products
Search
Document Center

PolarDB:ST_asText

Last Updated:Mar 28, 2026

Converts a pcpoint or pcpatch object to a JSON-formatted string. Use this function to inspect point cloud data in a human-readable format, debug queries, or export data to downstream systems.

Syntax

text ST_asText(pcpatch pp);
text ST_asText(pcpoint pt);

Return type: text

Parameters

ParameterTypeDescription
pppcpatchA point cloud patch object (a collection of points).
ptpcpointA point cloud point object.

Examples

Convert a pcpoint to JSON

SELECT ST_asText('010100000064CEFFFF94110000703000000400'::pcpoint);

Output:

{"pcid":1,"pt":[-127,45,124,4]}

The output fields are:

  • pcid: The point cloud schema ID, which defines the dimensions stored in each point.

  • pt: An array of dimension values. The position of each value corresponds to a dimension in the schema.