S Dille wrote:
> Hi,
>     I have a question about rendering images.  What would cause a 8 MB jpg
> file to take about 20 minutes to render, while a 5 MB TIF file renders in
> about 1 second?  I am simply opening these in a JMapPane, while using a
> StreamingRenderer and I'm kind of lost on how to increase rendering
> performance for images.  Both files are georeferenced with projection and
> world files.  Below is my code for inserting the images:
> 
> AbstractGridFormat format = GridFormatFinder.findFormat(imageFile);
> readImage = format.getReader(imageFile);  //readImage is an
> AbstractGridCoverage2DReader object
> 
> GridCoverage2D covLayer = null;
> try {  
>      covLayer = (GridCoverage2D) readImage.read(null);
> } catch (Exception e) {
>       e.printStackTrace();
> }
> 
> mapContext.addLayer(covLayer,Style);
> 
> 
> I know this is a pretty general question, but are there any image or JAI
> experts that can point me in the right direction on how I can find out why
> some files take so long to render, while other similarly sized images load
> quickly?

Most likely because the tiff is not compressed whilst the jpeg is.
And the jpeg has to be fully decompressed in memory before being
used, an 8MB jpeg is also a huge image

As a rule of thumb stay away from jpeg and use tiff files with
overviews and inner tiling if you want good rendering performance

Cheers
Andrea

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to