From: Tom Lane Date: Thu, 8 Aug 2002 14:29:07 +0000 (+0000) Subject: Some improvements in geometric-operators documentation. X-Git-Tag: REL7_3~984 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d176fad58059b7e652998a37da5cb9788ec7ea40;p=postgresql Some improvements in geometric-operators documentation. --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index aed47db79b..8d722a9185 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -3868,7 +3868,7 @@ SELECT TIMESTAMP 'now'; # - Number of points in polygon + Number of points in path or polygon # '((1,0),(0,1),(-1,0))' @@ -4025,6 +4025,18 @@ SELECT TIMESTAMP 'now'; length of item length(path '((-1,0),(1,0))') + + npoints(path) + integer + number of points + npoints(path '[(0,0),(1,1),(2,0)]') + + + npoints(polygon) + integer + number of points + npoints(polygon '((1,1),(0,0))') + pclose(path) path @@ -4040,12 +4052,6 @@ SELECT TIMESTAMP 'now'; point(lseg '((-1,0),(1,0))',lseg '((-2,-2),(2,2))') ]]> - - npoint(path) - integer - number of points - npoints(path '[(0,0),(1,1),(2,0)]') - popen(path) path @@ -4150,7 +4156,7 @@ SELECT TIMESTAMP 'now'; polygon(box) polygon - 12 point polygon + 4-point polygon polygon(box '((0,0),(1,1))') @@ -4175,6 +4181,16 @@ SELECT TIMESTAMP 'now'; + + It is possible to access the two component numbers of a point + as though it were an array with subscripts 0,1. For example, if + t.p is a point column then + SELECT p[0] FROM t retrieves the X coordinate; + UPDATE t SET p[1] = ... changes the Y coordinate. + In the same way, a box or an lseg may be treated + as an array of two points. + +