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
| Parameter | Description |
|---|---|
pc | The pcpatch object. |
n | The 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]}