Skip to content

Commit

Permalink
Merge branch 'master' into factorOutDrtOptimizationConstrains
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuehnel authored May 3, 2024
2 parents 6766668 + 5b67113 commit ca699ed
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
*
*/
public class GeometryUtils {

private static final GeometryFactory GEOMETRY_FACTORY = new GeometryFactory();

private GeometryUtils() {} // do not instantiate

/**
Expand Down Expand Up @@ -101,13 +104,13 @@ public static List<Link> findIntersectingLinks(LineString lineString, final Netw
public static LineString createGeotoolsLineString(Link link) {
Coordinate fromCoord = MGC.coord2Coordinate( link.getFromNode().getCoord() ) ;
Coordinate toCoord = MGC.coord2Coordinate( link.getToNode().getCoord() ) ;
LineString theSegment = new GeometryFactory().createLineString(new Coordinate[]{ fromCoord, toCoord });
LineString theSegment = GEOMETRY_FACTORY.createLineString(new Coordinate[] { fromCoord, toCoord });
return theSegment;
}

public static Point createGeotoolsPoint(Coord coord ) {
Coordinate coordinate = MGC.coord2Coordinate(coord) ;
Point point = new GeometryFactory().createPoint( coordinate ) ;
Point point = GEOMETRY_FACTORY.createPoint(coordinate);
return point ;
}

Expand Down

0 comments on commit ca699ed

Please sign in to comment.