Geometric Data Types
PostgreSQL supports six data types that represent two-dimensional geometric objects. The most basic geometric data type is the POINT —as you might expect, a POINT represents a point within a two-dimensional plane.
A POINT is composed of an x-coordinate and a y-coordinate—each coordinate is a DOUBLE PRECISION number.
The LSEG data type represents a two-dimensional line segment. When you create a LSEG value, you specify two points—the starting POINT and the ending POINT.
A BOX value is used to define a rectangle—the two points that define a box specify opposite corners.
A PATH is a collection of an arbitrary number of POINTs that are connected. A PATH can specify either a closed path or an open path. In a closed path, the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access