Hi,
on Windows, the ECW driver is supported as a plugin.
Did you configured the GDAL_DRIVER_PATH variable to refer to the ECW SDK
downloaded DLLs?
Does gdalinfo (from the installed GDAL native libs) invoked against the ECW
file report it as a recognized format?
Please, let us know.
Best Regards,
Daniele
2012/3/2 Vicente Suárez Herrero <[email protected]>
> Hi,
>
> I am trying to load an ECW map with GeoTools but I am having some problems
> so I have been unable to achieve this.
>
> As I read in the GeoTools user's guide, I have downloaded and configured
> the imageio and imageio-ext libraries, and I have added the Maven
> dependencies to my project.
> I have also copied the GDAL native libraries and installed de ECW SDK for
> read only (downloaded form the ERDAS page)
>
> When executing gdalinfo I can see that GDAL is correctly installed and
> reviewing the project libraries I found the imageio-ext libraries (version
> 1.0.8). I am using GeoTools 2.7.2 version in Windows XP
>
> My code is based on the ImageLab tutorial, but when executing the
> following instance:
>
> AbstractGridFormat format = GridFormatFinder.findFormat( rasterFile )
>
> I get this exception
>
> Exception in thread "main" java.lang.UnsupportedOperationException: Trying
> to get a reader from an unknown format.
> at
> org.geotools.coverage.grid.io.UnknownFormat.getReader(UnknownFormat.java:62)
> at org.geotools.test.LoadECWMap.displayLayers(LoadECWMap.java:87)
> at org.geotools.test.LoadECWMap.getMapAndDisplay(LoadECWMap.java:134)
> at org.geotools.test.LoadECWMap.main(LoadECWMap.java:139)
>
> This code works perfectly with TIF maps.
>
>
> If I change the code to use directly an ECWFormat object:
>
> ECWFormat format = new ECWFormat();
> reader = format.getReader(rasterFile);
>
> it raises the following exception:
>
> Exception in thread "main" java.lang.RuntimeException: The Provided input
> is not supported by this reader
> at
> it.geosolutions.imageio.gdalframework.GDALImageReader.setInput(GDALImageReader.java:851)
> at
> it.geosolutions.imageio.plugins.ecw.ECWImageReader.setInput(ECWImageReader.java:60)
> at javax.imageio.ImageReader.setInput(ImageReader.java:380)
> at
> org.geotools.coverageio.BaseGridCoverage2DReader.<init>(BaseGridCoverage2DReader.java:171)
> at
> org.geotools.coverageio.gdal.BaseGDALGridCoverage2DReader.<init>(BaseGDALGridCoverage2DReader.java:83)
> at org.geotools.coverageio.gdal.ecw.ECWReader.<init>(ECWReader.java:67)
> at org.geotools.coverageio.gdal.ecw.ECWFormat.getReader(ECWFormat.java:92)
> at org.geotools.coverageio.gdal.ecw.ECWFormat.getReader(ECWFormat.java:44)
> at
> org.geotools.coverageio.gdal.BaseGDALGridFormat.getReader(BaseGDALGridFormat.java:163)
> at org.geotools.test.LoadECWMap.displayLayers(LoadECWMap.java:87)
> at org.geotools.test.LoadECWMap.getMapAndDisplay(LoadECWMap.java:134)
> at org.geotools.test.LoadECWMap.main(LoadECWMap.java:139)
>
>
> The ECW map is ok and a can see it with IrfanView using the appropriate
> plugin.
>
> What am I doing wrong? Is there anything that I am missing?
>
>
> Thanks in advance.
>
> Regards.
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
--
-------------------------------------------------------
Ing. Daniele Romagnoli
GeoSolutions S.A.S.
Software Engineer
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://it.linkedin.com/in/danieleromagnoli
-------------------------------------------------------
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users