All Products
Search
Document Center

PolarDB:ST_pointN

Last Updated:Mar 28, 2026

Returns the nth point from a pcpatch object using 1-based indexing. Negative values count from the end, so -1 is the last point.

Syntax

pcpoint ST_pointN(pcpatch pc, integer n);

Parameters

ParameterDescription
pcThe pcpatch object.
nThe position of the point to return, starting at 1. Negative values count from the end: -1 is the last point, -2 is the second-to-last, and so on.

Examples

Retrieve the fourth point from a patch:

SELECT ST_asText(ST_pointN(pa, 4)) FROM patches WHERE id = 7;

Output:

{"pcid":1,"pt":[-126.41,45.59,59,5]}