@Test public void testPolyWithPoly() { final SimpleFeature feature1 = createFeature( factory.createPolygon( new Coordinate[] { new Coordinate(0.000, 0.000), new Coordinate(-0.000, -0.001), new Coordinate(-0.001, -0.001), new Coordinate(0.00, 0.00)})); final SimpleFeature feature2 = createFeature( factory.createPolygon( new Coordinate[] { new Coordinate(0.001, 0.001), new Coordinate(0.001, 0.002), new Coordinate(0.002, 0.002), new Coordinate(0.001, 0.001)})); testBounds(functionUnderTest.measure(feature1, feature2), 100, 200); }
@Override public double measure(final SimpleFeature x, final SimpleFeature y) { double dist = Double.MAX_VALUE; final Coordinate[] coords = new DistanceOp(getGeometry(x), getGeometry(y)).nearestPoints(); for (int i = 0; i < coords.length; i++) { for (int j = i + 1; j < coords.length; j++) { dist = Math.min(dist, coordinateDistanceFunction.measure(coords[j], coords[i])); } } return dist; }
FeatureDistanceFn implements DistanceFn<SimpleFeature> { @Override public double measure(final SimpleFeature x, final SimpleFeature y) { double dist = Double.MAX_VALUE; final Coordinate[] coords = new DistanceOp(getGeometry(x), getGeometry(y)).nearestPoints(); for (int i = 0; i < coords.length; i++) { for (int j = i + 1; j < coords.length; j++) { dist = Math.min(dist, coordinateDistanceFunction.measure(coords[j], coords[i])); } } return dist; } }
FeatureDistanceFn implements DistanceFn<SimpleFeature> { @Override public double measure(final SimpleFeature x, final SimpleFeature y) { double dist = Double.MAX_VALUE; final Coordinate[] coords = new DistanceOp(getGeometry(x), getGeometry(y)).nearestPoints(); for (int i = 0; i < coords.length; i++) { for (int j = i + 1; j < coords.length; j++) { dist = Math.min(dist, coordinateDistanceFunction.measure(coords[j], coords[i])); } } return dist; } FeatureDistanceFn();  FeatureDistanceFn(final DistanceFn<Coordinate> coordinateDistanceFunction); }
FeatureDistanceFn implements DistanceFn<SimpleFeature> { @Override public double measure(final SimpleFeature x, final SimpleFeature y) { double dist = Double.MAX_VALUE; final Coordinate[] coords = new DistanceOp(getGeometry(x), getGeometry(y)).nearestPoints(); for (int i = 0; i < coords.length; i++) { for (int j = i + 1; j < coords.length; j++) { dist = Math.min(dist, coordinateDistanceFunction.measure(coords[j], coords[i])); } } return dist; } FeatureDistanceFn();  FeatureDistanceFn(final DistanceFn<Coordinate> coordinateDistanceFunction); DistanceFn<Coordinate> getCoordinateDistanceFunction(); void setCoordinateDistanceFunction(
      final DistanceFn<Coordinate> coordinateDistanceFunction); @Override double measure(final SimpleFeature x, final SimpleFeature y); }
FeatureDistanceFn implements DistanceFn<SimpleFeature> { @Override public double measure(final SimpleFeature x, final SimpleFeature y) { double dist = Double.MAX_VALUE; final Coordinate[] coords = new DistanceOp(getGeometry(x), getGeometry(y)).nearestPoints(); for (int i = 0; i < coords.length; i++) { for (int j = i + 1; j < coords.length; j++) { dist = Math.min(dist, coordinateDistanceFunction.measure(coords[j], coords[i])); } } return dist; } FeatureDistanceFn();  FeatureDistanceFn(final DistanceFn<Coordinate> coordinateDistanceFunction); DistanceFn<Coordinate> getCoordinateDistanceFunction(); void setCoordinateDistanceFunction(
      final DistanceFn<Coordinate> coordinateDistanceFunction); @Override double measure(final SimpleFeature x, final SimpleFeature y);  }