Hi Duygu,
please, read belove....

On Sat, Jan 24, 2009 at 2:47 PM, Duygu Altinok
<duygu_the_du...@hotmail.com>wrote:

>
> Hi Michael ,
> I managed to read maps in dted & geotiff & ecw formats   , but I have
> problems with rendering them.Here the code snippet I wrote for reading a
> dted file :
>
> File file =........
> ImageReader reader = new DTEDImageReaderSpi().createReaderInstance();
> reader.setInput(file);
> RenderedImage image = reader.read(0);


In this code snippet, you are using the low level ImageIO classes (the set
of classes providing low level access capabilities to a file).
In case your aim is working on grid coverages and their properties
(Envelope, CoordinateReferenceSystem,...) I suggest to you using the
Geotools classes instead.
A Geotools grid coverage reader is based on a proper ImageIO ImageReader.
(In this specific case the Geotools DTEDReader class is internally based on
the DTEDImageReader class).

Therefore, you should use this code:
------------------------------------------------------------------------------------
File file = .....
DTEDReader reader = new DTEDReader(file);

GridCoverage2D gc = (GridCoverage2D) reader.read(null);
gc.show();
-------------------------------------------------------------------------------------

The gc.show() call will do the trick (rendering your file).



>
>
> The code works  , now I wanted to render this image :
>
> ImagePane imp = new ImagePane();
> imp.setImage(image);
> imp.setVisible(true);
>
> But this doesn't work , :,( I think it should work to render the read map ,
> but it doesn't and I  dunno why.Can you lend me a hand?:-D


I'm not too familiar with the ImagePane classes. I guess someone on the list
will give you additional help on it.

Regards,
Daniele


>
> --
> View this message in context:
> http://n2.nabble.com/reading---rendering-dem----dted-files-tp2157436p2208826.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>



-- 
-------------------------------------------------------
Eng. Daniele Romagnoli
Software Engineer

GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax:     +39 0584983027
mob:   +39 328 0559267


http://www.geo-solutions.it

-------------------------------------------------------
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to