// TODO: Introduce PreparedGeometry
private static void findIntersection(Map<String, LineString> linesByName) {
        for (Entry<String, LineString> entryA : linesByName.entrySet()) {
            for (Entry<String, LineString> entryB : linesByName.entrySet()) {
                System.out.println("Checking " + entryA.getKey() + " against "
                        + entryB.getKey());
                if (entryA.equals(entryB))
                    continue;
                // TODO: Introduce PreparedGeometry
                if (entryA.getValue().intersects(entryB.getValue())) {
                    System.out.println(entryA.getKey() + " intersects "
                            + entryB.getKey());
                    lineStringToJSON(entryA);
                    lineStringToJSON(entryB);
                    System.out
                            .println("Intersection is "
                                    + entryA.getValue().intersection(
                                            entryB.getValue()));
                    System.exit(0);
                }
            }
        }
    }
if (entryA.equals(entryB))
continue;
// TODO: Introduce PreparedGeometry
if (entryA.getValue().intersects(entryB.getValue())) {
System.out.println(entryA.getKey() + " intersects "
private static void findIntersection(Map<String, LineString> linesByName) {
for (Entry<String, LineString> entryA : linesByName.entrySet()) {
for (Entry<String, LineString> entryB : linesByName.entrySet()) {
System.out.println("Checking " + entryA.getKey() + " against "
+ entryB.getKey());
if (entryA.equals(entryB))
continue;
// TODO: Introduce PreparedGeometry
if (entryA.getValue().intersects(entryB.getValue())) {
System.out.println(entryA.getKey() + " intersects "
+ entryB.getKey());
lineStringToJSON(entryA);
lineStringToJSON(entryB);
System.out
.println("Intersection is "
+ entryA.getValue().intersection(
entryB.getValue()));
System.exit(0);
private static void findIntersection(Map<String, LineString> linesByName) {
for (Entry<String, LineString> entryA : linesByName.entrySet()) {
for (Entry<String, LineString> entryB : linesByName.entrySet()) {
System.out.println("Checking " + entryA.getKey() + " against "
+ entryB.getKey());
if (entryA.equals(entryB))
continue;
// TODO: Introduce PreparedGeometry
if (entryA.getValue().intersects(entryB.getValue())) {
System.out.println(entryA.getKey() + " intersects "
+ entryB.getKey());
lineStringToJSON(entryA);
lineStringToJSON(entryB);
System.out
.println("Intersection is "
+ entryA.getValue().intersection(
entryB.getValue()));
System.exit(0);
}
}
}
}