ST_LineString data type
The ST_LineString data type is a one-dimensional object stored as a sequence of points defining a linear interpolated path. ST_LineString types are often used to define linear features such as roads, rivers, and power lines.
Properties
An ST_LineString is simple if it does not intersect its interior. The endpoints (the boundary) of a closed ST_LineString occupy the same point in space. An ST_LineString is a ring if it is both closed and simple. In addition to properties inherited from the superclass ST_Geometry, ST_LineString values have length.
Functions
- ST_StartPoint()
- The function returns the linestring's first point.
- ST_EndPoint()
- The function returns the linestring's last point.
- ST_PointN()
- The function takes an ST_LineString and an index to nth point and returns that point.
- ST_Length()
- The function returns the linestring's length as a double-precision number.
- ST_NumPoints()
- The function returns the number of points in the linestring's sequence as an integer.
- ST_IsRing()
- The function returns
t
(TRUE) if the ST_LineString is a ring andf
(FALSE) otherwise. - ST_IsClosed()
- The function returns
t
(TRUE) if the ST_LineString is closed andf
(FALSE) otherwise. - ST_Polygon()
- The function creates a polygon from an ST_LineString that is a ring.