I am searching for a method or algorithm similar to DbGeography.Intersects(). This method compares two lines and returns true, if they cross each other. If they don't touch each other, or one line ends directly on the other line, it returns false. Is there a way to determine, if one lines ends directly on the other line?
Asked
Active
Viewed 397 times
1 Answers
2
Checking if a point is in a line only works in theoretical matehmatics. In the real world there is no such accuracy that allows to assert if a point is in a line or not.
In the real world your problem is solved by checking if the distance between the point and the line is smaller than a given threshold.
So you need to use public Nullable Distance(DbGeography other):
var pointInLine = point.Distance(line) < threshold;

JotaBe
- 38,030
- 8
- 98
- 117