14,498 questions
How to find midpoint of a polyline
Shaun Gibbins
0
Reputation points
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.
SQL Server | Other
Sign in to answer