From: Jody G. <jga...@re...> - 2007-09-23 14:05:21
|
Figured it out; the code expects the initial file to be the jpg, I was opening the jgw file (the layer of insulation between uDig where I was stealing code from; and raw geotools led me astray). That said I ran out of memory with the defaultVM size ;-) Jody Jody Garnett wrote:Jody Garnett wrote: > Well I asked for an example of how to read a world + image file last > month - so this month I am trying to write it myself. > >> File file = getImageFile( args ); >> WorldImageReader reader = new WorldImageReader( file ); >> final GridCoverage2D coverage = (GridCoverage2D) >> reader.read(null); >> >> System.out.println( coverage.getEnvelope() ); >> System.out.println( coverage.getRenderedImage() ); >> System.out.println( coverage.getRenderedImage().getData() ); >> coverage.show(); >> > Problem is the code hangs (at least when using the earthlights.jpg and > clouds.jpg available in the uDig sample dataset). Stepping through the > code with a debugger shows the point of no return being ... line number > 2. new WorldImageRedaer( file ). > > Navigating into the constructor shows the getHRInfo() method being > fatal; it passes over control to IIORegistry... > A call called TextReader; used by TextMatrixImageReader is stuck in an > endless loop. > > The environment I am running is is 2.4-RC0; the setup was to dump > everything into an eclipse project as per my recent wiki page. > > Help? > Jody > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > Well I asked for an example of how to read a world + image file last > month - so this month I am trying to write it myself. > >> File file = getImageFile( args ); >> WorldImageReader reader = new WorldImageReader( file ); >> final GridCoverage2D coverage = (GridCoverage2D) >> reader.read(null); >> >> System.out.println( coverage.getEnvelope() ); >> System.out.println( coverage.getRenderedImage() ); >> System.out.println( coverage.getRenderedImage().getData() ); >> coverage.show(); >> > Problem is the code hangs (at least when using the earthlights.jpg and > clouds.jpg available in the uDig sample dataset). Stepping through the > code with a debugger shows the point of no return being ... line number > 2. new WorldImageRedaer( file ). > > Navigating into the constructor shows the getHRInfo() method being > fatal; it passes over control to IIORegistry... > A call called TextReader; used by TextMatrixImageReader is stuck in an > endless loop. > > The environment I am running is is 2.4-RC0; the setup was to dump > everything into an eclipse project as per my recent wiki page. > > Help? > Jody > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |