/**
     * @param singlePointSegments
     * @param string
     *            private static void writeSegmentsToFile(List<Segment>
     *            segments, String fileName) { GeometryJSON geometryJson = new
     *            GeometryJSON(DIGITS_OF_PRECISION); File outFile = new
     *            File(fileName); OutputStream oStream = null; try { oStream =
     *            new FileOutputStream(outFile); for (Segment segment :
     *            segments) { geometryJson.write(((SegmentImpl)
     *            segment).getLineString(), oStream); } } catch
     *            (FileNotFoundException e) { e.printStackTrace(); } catch
     *            (IOException e) { // TODO Auto-generated catch block
     *            e.printStackTrace(); } finally { try { if (oStream != null) {
     *            oStream.close(); } } catch (IOException e) { // Don't care } }
     * 
     *            }
     */
/**
     * @param segment
     * @deprecated - Move toward LineFeature private static boolean
     *             validateSegment(Segment segment) { if
     *             (segment.getStart().matchesLocation((segment.getEnd()))) {
     *             System.out.println("Single Point Line?"); return true; } else
     *             { return false; } }
     */
/**
     * @param linesByName
     */
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);
}
}
}
}
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);
}
}
}
}