Our postgres database has tables that have a "path" data type consisting of a list of points that make up a line. Is there any way in postGIS or postgres to extract the first and last coordinate pairs from each entry? The purpose is to determine the cardinal direction of each line using ST_Azimuth, but that function requires the coordinates of the first and last point.
I've tried every way I can think of, but the path data type doesn't act like a string or an array, so it's difficult to pull out items from it.
LINESTRING
. just an fyi. ;)