Hi Anaxa,
Anaxa Gore a écrit :
> Hi,
>
> I am using GT 2.5 trunk and am trying to create a GeotiffReader, using
> this code :
>
> GeoTiffReader reader;
> try {
> reader = new GeoTiffReader(geotiff);
> gc2d = (GridCoverage2D)reader.read(null);
> } catch (DataSourceException ex) {
> Logger.getLogger(GeoTiffSource.class.getName()).log(Level.SEVERE,
> "Unable to read "+geotiff.getName(),ex);
> } catch (IOException ioe){
> Logger.getLogger(GeoTiffSource.class.getName()).log(Level.SEVERE,
> "Unable to read "+geotiff.getName(),ioe);
> }
>
> where geotiff is a java.io.File.
> But I get this exception :
>
Have you tried this code :
reader.setInput(new File("your_geotiff_path"));
just after the instanciation.
Cheers,
Cédric.
> java.lang.IllegalArgumentException: No input stream for the provided
> source
> at
> org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:204)
> at
> org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:122)
> at
> org.puzzle.format.geotiff.service.GeoTiffSource.<init>(GeoTiffSource.java:74)
> at
> org.puzzle.format.geotiff.service.GeoTiffSourceService.restoreSource(GeoTiffSourceService.java:56)
> at
> org.puzzle.format.geotiff.service.GeoTiffSourceService.createSource(GeoTiffSourceService.java:85)
> at
> org.puzzle.puzzlecore.context.gui.datadialog.JFileSourcePane.getGISSources(JFileSourcePane.java:116)
> at
> org.puzzle.puzzlecore.context.action.addlayer.AddFileLayerAction$1.actionPerformed(AddFileLayerAction.java:57)
> at
> org.netbeans.core.windows.services.NbPresenter$ButtonListener.actionPerformed(NbPresenter.java:1106)
> at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
> at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
> at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
> at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
> at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
> at java.awt.Component.processMouseEvent(Component.java:6134)
> at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
> at java.awt.Component.processEvent(Component.java:5899)
>
> If somebody gets an idea... Thanks to let me know about it, because I
> can't find any information for fix it.
> Thomas
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users