From: Andrea A. <and...@ge...> - 2010-12-21 17:57:03
|
On Tue, Dec 21, 2010 at 4:29 PM, Ian Turton <ijt...@gm...> wrote: > On Mon, Dec 20, 2010 at 11:48 PM, Michael Bedward > <mic...@gm...> wrote: > > Hi Ian, > > > > I do this... > > > > public GridCoverage2D createCoverage(double[][] data, String name, > > Envelope env) { > > int width = data[0].length; > > int height = data.length; > > WritableRaster raster = > > RasterFactory.createBandedRaster(DataBuffer.TYPE_DOUBLE, width, > > height, 1, null); > > > > for (int y = 0; y < height; y++) { > > for (int x = 0; x < width; x++) { > > raster.setSample(x, y, 0, data[y][x]); > > } > > } > > > > That's the sort of thing I was trying, is there a way to do this with > world x,y coords instead of image coords? > I think that is normally called interpolation :-) Look for Inverse Distance Weighted, tensioned splines, or Kriging (I don't think we have an implementation of any, IDW is trivial to implement though, at least a low performance version of it): http://en.wikipedia.org/wiki/Inverse_distance_weighting Cheers Andrea ----------------------------------------------------- Ing. Andrea Aime Senior Software Engineer GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584962313 fax: +39 0584962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ----------------------------------------------------- |