[Geotools-gt2-users] jai convolve problems - solved

2008-04-30 Thread Michael Bedward
Dear geotoolers, A small follow up which might be useful to others working with grid coverages on Mac OS X... The problem I was having with convolution of float rasters apparently only afflicts Mac intel users and is caused by some glitch with the library used for native acceleration of JAI's fun

Re: [Geotools-gt2-users] jai convolve problems

2008-04-30 Thread Michael Bedward
G'day Steve, Thanks for your reply. Your code is similar to what I've been doing. I was calling ConvolveDescriptor.create() but peering into the JAI source code (yikes) all that happens there is that it loads a parameter block and calls JAI.create() for you. Do you use float or double data grid

Re: [Geotools-gt2-users] jai convolve problems

2008-04-30 Thread Steve Ansari
Hello Michael, I've run into problems with using even sized kernels (such as 10x10) on Mac. This was an accident - I actually wanted odd sized only. Anyway, this is how I do convolve: float[] kernelMatrix = new float[kernelSize*kernelSize]; for (int k=0; k Dear GT-Gurus,

Re: [Geotools-gt2-users] Fwd: Creating an empty GridCoverage2D

2008-04-30 Thread Simone Giannecchini
As an alternative, you may want to play with ImageFunction JAI operator, see http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ImageFunctionDescriptor.html. Which should better use memory, especially if coupled with tiling and tile caching. Simone. On

Re: [Geotools-gt2-users] Fwd: Creating an empty GridCoverage2D

2008-04-30 Thread Simone Giannecchini
I guess the easiest thing to do is first create an empty image and then feed it to a gridcoverage factory. Easiest way to create an empty raster with some initial values for each band is the Constant JAI operator. See http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/me

Re: [Geotools-gt2-users] Fwd: Creating an empty GridCoverage2D

2008-04-30 Thread Michael Bedward
Hi Thomas, Here's one way, though there are probably much simpler ways. This would create a floating point image. Edit for type byte, or int or whatever... int size = rows * cols; float[] data = new float[size]; DataBuffer buffer = new DataBufferFloat( data, size ); Samp

[Geotools-gt2-users] Fwd: Creating an empty GridCoverage2D

2008-04-30 Thread Anaxa Gore
Hi, I would like to create an "empty" single band GridCoverage2D (all points at "0"). Next, I perform a calculation on some datas, and put points of interest into this GridCoverage (with value other than 0), depending on their geographic position... Finally, I vectorize this gridcoverage to get a