Define a couple of points as follows:
declare @p1 geography, @p2 geography
set @p1 = 'POINT(1 2)'
set @p2 = 'POINT(6 8)'
Now I'd like to obtain the shortest line between these two points. What function can I use to get this line? (i.e., it should output a LINESTRING(1 2, 6 8) or LINESTRING(6 8, 1 2))
I know I could do this by formatting the points as WKT, doing a bit of string manipulation, and then parsing it back, but that seems ridiculous. Surely there's some way to construct a linestring directly from a series of points?
(With "geometry" types, I can use @p2.STUnion(@p1).STConvexHull(), but there's no STConvexHull() for a geography type.)