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? Note: The segments are close enough to each other, so ain't here issues of Great-circle
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 this Stackoverflow Q 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 GIS solution, it asked also in gis stackexchange.