SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,758 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How would you calculate the x,y of the midpoint of a polyline with MS SQL Server?
I can get start point and end point by using shape.STStartPoint().ToString() and shape.STEndPoint().ToString()
An arbitrary point using shape.STPointOnSurface().ToString() but can't seem to find a method to get the midpoint
For polygon I can use shape.STCentroid().ToString() but there doesn't seem to be a similar method for lines.
I am basically trying to achieve the same as the postGIS example in the attached screeny.