Hey Ede, thanks for the explanation. Temp files sounds a way to explore
the raster management. I also wonder if we explore the way to reduce using
so many
2D arrays and use DataBufferDouble as single array which uses less memory

I did some test on my Raster tools. I also explore a bit into
RasterImageIO, RasterImage , AddRasterImageLayerWizard and TiffUtilsV2 (OJ
1.16) classes to understand how the framework does the job. I realized that
methods in RasterImageIO can be simplified, at least for JPG, JPG 2000,
GIF, BMP and PNG, for instance
reusing com.vividsolutions.jump.workbench.imagery.geoimg.GeoRaster which
works far better and possibly saves some memory. It requires of course some
implementation
as parameter JAI.create("ImageRead"...) seems to me not working with
JPG2000 while JAI.create("fileload"...) does.
I  added a class on package org.openjump.core.rasterimage.GeoRasterUtils
(OJ 1.16) that explains what I mean. It uses JAI/ImageIO
BTW. A method in class RasterImageIO, lreadCellValue(String filenameOrURL,
int col, int row,int band), reads the file instead of the build data[]
array and seems quite fast.

Peppe






Il giorno gio 2 dic 2021 alle ore 14:31 <edgar.sol...@web.de> ha scritto:

> well Peppe,
>
> again. as far as i understand, we are loading the Raster Data and Image to
> memory completely! with _our_ Raster-Image framework ;). so however good a
> image readers memory management is, the bottleneck is our implementation.
> what we do is
> - read the image data via driver
> - create a 2D data array (rasterdata) _and_ an image representation for
> display purposes
> both are held in memory in full, so the bigger the raster data ...
>
> as a first step i could imagine to write the image to a temp file and use
> JAI driver to access it in turn. that way we would free some memory. ..ede
>
> On 02.12.2021 13:53, Giuseppe Aruta wrote:
> > Hi Ede,
> > Does Apache commons manage the memory in a better way than JAI/ImageIO?
> > I really don't disagree with switching to Apache Commons and, thus,
> simplifying the code.
> > RasterImageIO support also reading (some) JPG 2000 (via JAI) which is
> not supported by Apache Commons.
> > Peppe
> >
> > Il giorno gio 2 dic 2021 alle ore 12:04 <edgar.sol...@web.de <mailto:
> edgar.sol...@web.de>> ha scritto:
> >
> >     On 02.12.2021 06:52, jump-pilot-svn--- via Jump-pilot-devel wrote:
> >     > Revision: 6677
> >     >           http://sourceforge.net/p/jump-pilot/code/6677
> >     > Author:   ma15569
> >     > Date:     2021-12-02 05:52:46 +0000 (Thu, 02 Dec 2021)
> >     > Log Message:
> >     > -----------
> >     > Inverted B/W color display for raster. TODO: to adopt to OpenJUMP
> 2.0
> >     >
> >
> >     as Raster is completely held in memory anyway what about switching
> over to Apache Commons Imaging in OJ2 completely? i added a plain display
> test implementation to the Commons Imaging Reader w while ago.
> >
> >     ..ede
> >
> >
> >     _______________________________________________
> >     Jump-pilot-devel mailing list
> >     Jump-pilot-devel@lists.sourceforge.net <mailto:
> Jump-pilot-devel@lists.sourceforge.net>
> >     https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
> >
> >
> > _______________________________________________
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
>
>
>
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to