I have ArratList<Segment>
(N segments - array size is N) when:
public class Segment {
Node vertex_1;
Node vertex_2;
}
public class Node {
double latitude;
double longitude;
}
And one static point - origin point. How to work with GeoTools in order to get ArrayList<boolean>
(size N) where each value is true/false regarding the question:
Is the 2 lines from origin point to both edges of the segment, intersects some other segments on their way?
For example here the result is {true, false, false} because the red line from origin point to second edge of segment 1 intersects on her way segment 3.
This question is similar to Algorithm to find intersections in a polar plane on StackOverflow but the difference is that here I want to work with GeoTools instead of implementing the algorithm which involving translation of Geographic measurement units (lat/lon) into polar plane and performing some math calculation such as cross products - Not difficult but has potential for bugs, and if there is already ready open source library it's better to use it.
Because this question involving code solution, it asked also as Calculating intersection between lines with GeoTools (java) at StackOverflow.