hey list, 
I am a little confused because I guess I am making something terrible wrong. 
I want to create a list from an image (taken from a gridcoverage2D) in a
form like this:

x     y     value
1.0  1.0  5.2

this is my current code snippet. I am confused how to recieve x and y
coordinates. because it seems that dArray only returns the values of the
pixel. am i right?
        int i = 0;
                if (!iter.finishedBands()) do {
                        iter.startLines();
                        if (!iter.finishedLines()) do {
                                iter.startPixels();
                                if (!iter.finishedPixels()) do {
                                        pixelArray = iter.getPixel(dArray);
                                        double xx = pixelArray[2];
                                        double yy = pixelArray[1];
                                        double attribut = pixelArray[0];
                                        gridList[i][0] = xx;
                                        gridList[i][1] = yy;
                                        gridList[i][2] = attribut;
                                        System.out.println(gridList[i][0] + ", 
" + gridList[i][1] + ", " +
gridList[i][2]);
                                        i++;
                                } while (!iter.nextPixelDone());
                        } while (!iter.nextLineDone());
                } while (!iter.nextBandDone());

Another question is how to get real world coordinates from the grid coverage
2D? Any idea?
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/GridCoverage2D-values-and-coordinates-tp5003644p5003644.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to