This function returns the pcpoint object with the specified sequence number in a pcpatch object.

Syntax

pcpoint ST_pointN(pcpatch pc, integer n);

Parameters

Parameter Description
pc The pcpatch object.
n The sequence number of the pcpoint object, starting from 1. If n is a negative number, it specifies the pcpoint object with the sequence number of |n| starting from the end of the pcpatch object reversely. For example, a value of -2 indicates the last but one pcpoint object in the pcpatch object.

Examples

SELECT ST_asText(ST_pointN(pa, 4)) FROM patches WHERE id = 7;
----------------------------------
{"pcid":1,"pt":[-126.41,45.59,59,5]}