Dear list,

I am trying to upgrade our GeoTools 2.2.0 application to GeoTools 2.3.0
to benefit from the improved raster support. However, I am having some
difficulties creating a GridCoverage from a GIF image with a world file.
First, I have tried this:

BufferedImage image = ImageIO.read(new File(aImageFileName));
CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
Envelope env = new Envelope2D(crs, -180, -90, 360, 180);
GridCoverageFactory gcf = FactoryFinder.getGridCoverageFactory(null);
GridCoverage gridcoverage = gcf.create(aName, image, env); 

This causes an illegalArgumentException: The number of image bands (4)
differs from the number of supplied 'SampleDimension' objects (1).

If I create an array containing four sample dimensions, I get another
error: The number of image bands (1) differs from the number of supplied
'SampleDimension' objects (4). 

The code found in
http://sourceforge.net/mailarchive/forum.php?thread_id=31248725&forum_id
=12232 does work. However, a message "Could not load mediaLib
accelerator wrapper classes. Continuing in pure Java mode." is displayed
in the console. This message is caused by the fact that the jai dll's
(mlib_jai.dll and mlib_jai_mmx.dll) cannot be found. If I make sure
these dll's can be found, the JVM crashes: 

# An unexpected error has been detected by HotSpot Virtual Machine:
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10120445, pid=3316,
tid=3044
# Problematic frame:
# C  [mlib_jai.dll+0x120445]

Hopefully someone can point us in the right direction.

Kind regards,

Bas Vanmeulebrouk. 
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to