public static void main(String[] args) { SimpleMethodsExample example = new SimpleMethodsExample(); try { example.run(); } catch (Exception ex) { ex.printStackTrace(); } }
public TestCaseTextDialog(Frame frame, String title, boolean modal) { super(frame, title, modal); try { jbInit(); pack(); } catch (Exception ex) { ex.printStackTrace(); } }
public void findClosestPoint(String wktA, String wktB) { System.out.println("-------------------------------------"); try { Geometry A = wktRdr.read(wktA); Geometry B = wktRdr.read(wktB); System.out.println("Geometry A: " + A); System.out.println("Geometry B: " + B); DistanceOp distOp = new DistanceOp(A, B); double distance = distOp.distance(); System.out.println("Distance = " + distance); Coordinate[] closestPt = distOp.nearestPoints(); LineString closestPtLine = fact.createLineString(closestPt); System.out.println( "Closest points: " + closestPtLine + " (distance = " + closestPtLine.getLength() + ")"); } catch (Exception ex) { ex.printStackTrace(); } }