Re: Gridded2DSet

> The x-values are in samples[0] and the y-values are in samples[1];
> 
> Let you DEM be
> 
>       3.3   x                x   
> north   2.7       x
> 
>       1.3   x          x     x 
>             0.2  0.3    1.1   1.2
>                    east
> 
> Sampled points are represented bx "x".
> 
> You've got lenX = 3, lenY = 2, and, thus, must input 6 pairs of
> coordinates.
> So, samples is (something like): samples[0]={0.2,1.1,1.2, 0.2,0.3,1.2};
> // east, or x values
>                           and  samples[1]={1.3,1.3,1.3, 3.3,2.7,3.3}; // 
> north, or y values
> 


Hi Ugo, I am getting confused, I tried to implement the above, 

        //double[][] coords = new double[2][east.length];
        coords[0] = new double[east.length];
        coords[1] = new double[north.length];
        for (int i=0;i<coords[0].length;i++) {
            coords[0][i]=east[i];
            coords[1][i]=north[i];
        }

        for (int j=0;j<coords[0].length;j++) {
            System.out.println("e "+coords[0][j]);
        }
        for (int j=0;j<coords[1].length;j++) {
            System.out.println("n "+coords[1][j]);
        }

        and they look like your samples[0] and samples[1]

now you are saying i have an array double[2][east*north], that would be
3*4 in your example?
How would I fill this array?
Sorry, I am just feeling stupid, I do not get that!

Thanks Desiree


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: