[netcdf-java] geogrid subset problem

I am trying to use the GeoGrid.subset operation in the 2.2.22 jar. My input data set is global one minute bathy (the full Gebco data set), so lat extends from -90 to +90 = 10801 points, and lon extends -180 to +180 = 21601 points.

I need to slice off north and south of 85 degrees lat (in order to tile for google maps), so I build a bounds:

        LatLonRect bounds = new LatLonRect( new LatLonPointImpl
                                                                                
                ( -85, -180 ),
                                                                                
                170, 360 );

and call GeoGrid.subset on my input GeoGrid to produce say GG2. This works fine.

But I then go onto to subset GG2, to get say just the northwest quarter of the 'world' , and I get the following error

ucar.ma2.InvalidRangeException
        at ucar.ma2.Range.element(Range.java:337)
        at ucar.ma2.Range.<init>(Range.java:312)
        at ucar.nc2.Variable.makeSectionRanges(Variable.java:421)
        at ucar.nc2.Variable.read(Variable.java:603)
        at ucar.nc2.dataset.VariableDS._read(VariableDS.java:279)
        at ucar.nc2.Variable.read(Variable.java:643)
at ucar.nc2.dataset.CoordinateAxis1D.readValues(CoordinateAxis1D.java: 482)
        at ucar.nc2.dataset.CoordinateAxis1D.doRead(CoordinateAxis1D.java:431)
at ucar.nc2.dataset.CoordinateAxis1D.getCoordEdge(CoordinateAxis1D.java: 152)
        at ucar.nc2.dt.grid.GridCoordSys.getBoundingBox(GridCoordSys.java:879)
        at ucar.nc2.dt.grid.GridCoordSys.<init>(GridCoordSys.java:384)
        at ucar.nc2.dt.grid.GeoGrid.subset(GeoGrid.java:632)
        at ucar.nc2.dt.grid.GeoGrid.subset(GeoGrid.java:591)
        at glmpc.worldmap.tools.GebcoTiler.main(GebcoTiler.java:

I have no idea why this is happening. I can try to provide code and datafile if necessary.

Maybe Geogrid subsetting can not extend past one subset operaion. Is there shared state among the Geogrids maybe?

Any help gratefully appreciated.

Of course if any one has already cut up this dataset for Google Maps tiles I would very much like to talk to you ;)

Stuart



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