Distances { public static double ecartSurface(ILineString l1, ILineString l2) { return Distances.ecartSurface(l1, l2, 1.0); }  @Deprecated /** Distance euclidienne entre 2 points (en 2D ou 3D si les points ont un Z). * @Deprecated La méthode .distance de DirectPosition fait la même chose * */ static double distance(IDirectPosition dp1, IDirectPosition dp2); @Deprecated static double distance2D(IDirectPosition dp1, IDirectPosition dp2); static boolean proche(IDirectPosition dp1, IDirectPosition dp2,
      double distance); static double distancePointSegment(IDirectPosition M,
      IDirectPosition A, IDirectPosition B); static double distance(IDirectPosition point, ILineString line); static double distance(IDirectPosition point, IRing ring); static double distance(IDirectPosition point,
      IOrientableSurface surface); static double distance(IDirectPosition point,
      IDirectPositionList pointList); static double premiereComposanteHausdorff(ILineString l1,
      ILineString l2); static double hausdorff(ILineString L1, ILineString L2); static double hausdorff(ILineString l, IPoint p); static double distanceMoyenne(ILineString L1, ILineString L2); static double lineMedianDistance(ILineString l1, ILineString l2); static double lineMedianDistance2(ILineString l1, ILineString l2); static double ecartSurface(ILineString l1, ILineString l2); static double ecartSurface(ILineString l1, ILineString l2,
      double threshold); @SuppressWarnings("unchecked") static double distanceSurfacique(IGeometry geom, IGeometry geom2); static double distanceSurfacique(IPolygon A, IPolygon B); static double distanceSurfacique(IMultiSurface<IOrientableSurface> A,
      IMultiSurface<IOrientableSurface> B); static double distanceSurfaciqueRobuste(GM_Polygon A, GM_Polygon B,
      double min, double max); static double distanceSurfaciqueRobuste(IPolygon A, IPolygon B,
      double min, double max); static double distanceSurfaciqueRobuste(
      IMultiSurface<IOrientableSurface> A, IMultiSurface<IOrientableSurface> B); static double surfaceIntersection(IMultiSurface<IOrientableSurface> A,
      IMultiSurface<IOrientableSurface> B); static double surfaceUnion(IMultiSurface<IOrientableSurface> A,
      IMultiSurface<IOrientableSurface> B); static double exactitude(IPolygon A, IPolygon B); static double completude(IPolygon A, IPolygon B); static double exactitude(IMultiSurface<IOrientableSurface> A,
      IMultiSurface<IOrientableSurface> B); static double completude(IMultiSurface<IOrientableSurface> A,
      IMultiSurface<IOrientableSurface> B); static boolean associationSurfaces(IGeometry A, IGeometry B,
      double min, double coeff); static boolean associationSurfacesRobuste(IGeometry A, IGeometry B,
      double min, double coeff, double minDouglas, double maxDouglas); static Logger logger; }
@Test public void testEcartSurface() { ILineString l1 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(10,0)); ILineString l2 = new GM_LineString(new DirectPosition(0,10), new DirectPosition(10,10), new DirectPosition(10,30)); double ecart = Distances.ecartSurface(l1, l2); Assert.assertEquals(100, ecart, 0.001); ILineString l3 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(0,10)); ecart = Distances.ecartSurface(l1, l3); Assert.assertEquals(50, ecart, 0.001); ILineString l4 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(0,10), new DirectPosition(10,10), new DirectPosition(10,0)); ILineString l5 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(10,0)); ecart = Distances.ecartSurface(l5, l4); Assert.assertEquals(25, ecart, 0.001); }