pointsAndValues.put(new DirectPosition2D(crs, 45, 708), -9.5);
pointsAndValues.put(new DirectPosition2D(crs, 905, 350), 17.5);
pointsAndValues.put(new DirectPosition2D(crs, 905, 850), -45.5);
//now we can construct the Interpolation Object
TPSInterpolation interpolation = new TPSInterpolation(pointsAndValues, 2, 2, env);
// we can get and show coverage
(new GridCoverageFactory()).create("Intepolated Coverage", interpolation.get2DGrid(),
env).show();
// or we can interpolate value in any DirectPosition
System.out.print(interpolation.getValue(new DirectPosition2D(12.34, 15.123)));
/* AbstractInterpolation interpoaltion = new TPSInterpolation(
generatePositionsWithValues(env,15, 5),
env.getLength(0)/500,
env.getLength(1)/500,
env);*/
(new GridCoverageFactory()).create("Intepoalted Coverage", interpolation.get2DGrid(),
env).show();
AbstractInterpolation interp = new TPSInterpolation(generatePositionsWithValues(env,
15, 5));
Color[] colors = new Color[] {Color.BLUE, Color.CYAN, Color.WHITE, Color.YELLOW, Color.RED};
GridCoverage2D c= (new GridCoverageFactory()).create("Intepolated Coverage", interpolation.getRaster (), interpolation.getEnv(),
null, null, null, new Color[][] {colors}, null);