Returns the nth pcpoint from a pcpatch using 1-based indexing, where negative values count from the end of the patch.
Syntax
pcpoint ST_pointN(pcpatch pc, integer n);Parameters
| Parameter | Description |
|---|---|
pc | The pcpatch object. |
n | The 1-based position of the pcpoint to return. Negative values count from the end: -1 returns the last point, -2 returns the second-to-last, and so on. |
Examples
Return the 4th point from the patch where id = 7:
SELECT ST_asText(ST_pointN(pa, 4)) FROM patches WHERE id = 7;Output:
{"pcid":1,"pt":[-126.41,45.59,59,5]}