This project is read-only.

retrieve start point and angle of rotation

Topics: User Forum
Mar 6, 2007 at 11:18 AM

In today's problem of the day, I have a table containing line data and I want to write a query that returns the start point of the line and the angle of rotation of the line. Is this possible?


Mar 12, 2007 at 7:23 PM
For simple lines, you could use ST.StartPoint, ST.EndPoint and some trigonometry (here you define your axis of reference). For more complex lines, instead of the end point you could prefer to get an intermediary point. For example...
  • the middle point in terms of points quantity: ST.PointN(line, ST.NumPoints(line)/2)
  • the middle point in terms of line length: ST.LineInterpolatePoint(line, 0.5)
  • the point closer to the line centroid: ST.LineLocatePoint(line, ST.Centroid(line))

Best regards,
Ricardo Stuven.