PostgreSQL point(box) Function

The PostgreSQL point(box) function calculates the center point of the specified rectangle and returns that.

point(box) Syntax

This is the syntax of the PostgreSQL point(box) function:

point(box) -> point

Parameters

box

Required. a rectangle. E.g:box '(1,1),(-1,-1)'

Return value

The PostgreSQL point(box) function returns the center point of the rectangle specified by the parameter.

point(box) Examples

The following statement shows how to use the PostgreSQL point(box) function to return the center point of box '(1,1),(-1,-1)'.

SELECT point(box '(1,1),(-1,-1)');
 point
-------
 (0,0)

The following statement shows how to use the PostgreSQL point(box) function to return the center point of box '(2,2),(1,1)'.

SELECT point(box '(2,2),(1,1)');
   point
-----------
 (1.5,1.5)