Some improvements in geometric-operators documentation.
authorTom Lane
Thu, 8 Aug 2002 14:29:07 +0000 (14:29 +0000)
committerTom Lane
Thu, 8 Aug 2002 14:29:07 +0000 (14:29 +0000)
doc/src/sgml/func.sgml

index aed47db79b92de57db3e615c234429b100ceed9c..8d722a91853ece180cd4e7092040bb0142d46a27 100644 (file)
@@ -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.
+    
+