public static Geometry longestLine ( Geometry geomA , Geometry geomB ) { Coordinate [ ] coords = new MaxDistanceOp ( geomA , geomB ) . getCoordinatesDistance ( ) ; if ( coords != null ) { return geomA . getFactory ( ) . createLineString ( coords ) ; } return null ; }
Return the longest line between the points of two geometries .