0

I have a SQLite database, with point and linestring geometries. Between the points(blue) and the linestring(green) is a gap, which I want to close with another line(red). The line should have angle of 90 degres to the existing line and build a connection between the point and the line. Which are the best SQLite spatial functions to do this?

enter image description here

1

If you have a point(0, 0) and a linestring(2 0, 0 2), then the shortest connecting line (perpendicular) would be found by:

SELECT ST_ShortestLine(ST_GeomFromText('POINT(0 0)'), 
  ST_GeomFromText('LINESTRING(2 0, 0 2)'))

enter image description here

0

No idea whether it is the best, but ST_ClosestPoint(line, point) looks awfully tempting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.