@Test public void testSinglePoint() { p1.setDivergence(4.0f); distanceSet.add(p1); NicGeoPoint dstPoint = interpolator.interpolatePosition(distanceSet); assertEquals(p1.getX(), dstPoint.getX(), delta); assertEquals(p1.getY(), dstPoint.getY(), delta); }
@Override public T interpolatePosition(final SortedSet<T> points) { T result = pointFactory.newPoint(); final int size = points.size(); switch (size) { case 0: break; case 1: final NicGeoPoint singlePoint = points.first(); result.setXY(singlePoint.getX(), singlePoint.getY()); break; default: result = doInterpolatePosition(points); } return result; }
MetricInterpolation implements PositionInterpolator<T> { @Override public T interpolatePosition(final SortedSet<T> points) { T result = pointFactory.newPoint(); final int size = points.size(); switch (size) { case 0: break; case 1: final NicGeoPoint singlePoint = points.first(); result.setXY(singlePoint.getX(), singlePoint.getY()); break; default: result = doInterpolatePosition(points); } return result; } }
MetricInterpolation implements PositionInterpolator<T> { @Override public T interpolatePosition(final SortedSet<T> points) { T result = pointFactory.newPoint(); final int size = points.size(); switch (size) { case 0: break; case 1: final NicGeoPoint singlePoint = points.first(); result.setXY(singlePoint.getX(), singlePoint.getY()); break; default: result = doInterpolatePosition(points); } return result; } MetricInterpolation(final PointFactory<T> factory); }
MetricInterpolation implements PositionInterpolator<T> { @Override public T interpolatePosition(final SortedSet<T> points) { T result = pointFactory.newPoint(); final int size = points.size(); switch (size) { case 0: break; case 1: final NicGeoPoint singlePoint = points.first(); result.setXY(singlePoint.getX(), singlePoint.getY()); break; default: result = doInterpolatePosition(points); } return result; } MetricInterpolation(final PointFactory<T> factory); @Override T interpolatePosition(final SortedSet<T> points); }
MetricInterpolation implements PositionInterpolator<T> { @Override public T interpolatePosition(final SortedSet<T> points) { T result = pointFactory.newPoint(); final int size = points.size(); switch (size) { case 0: break; case 1: final NicGeoPoint singlePoint = points.first(); result.setXY(singlePoint.getX(), singlePoint.getY()); break; default: result = doInterpolatePosition(points); } return result; } MetricInterpolation(final PointFactory<T> factory); @Override T interpolatePosition(final SortedSet<T> points);  }