Dear all,
we kept working on the raster handling capabilities of
OJ. We focused on your indications about keeping the raster file-based,
and loading when possible only the part of the image that is needed for
display.
The RasterImageLayer class was deeply reworked, and we've
separated the display data from the actual cell data. Therefore now the
raster files are read as BufferedImage (we've removed the PlanarImages,
that implied some memory-consuming conversions between classes), and the
cells data are read only on request when the getRasterData() method is
called.
There are a couple of new methods to read a single cell values,
getCellValue(int, int), getCellValue(double, double), and
getCellValue(Coordinate).
There is a new class, RasterImageIO, where
we've grouped all the methods needed to load the different raster
formats. In particular, the part dedicate to TIFF images allows to load
only the part of the TIFF file that is needed for display. To do so, we
had to write some code to read in an efficient fashion the TIFF tags,
because the existing XTIFFDirectory and XTIFFField classes are slow (at
least in my tests) when reading large raster. Therefore there is a new
class, TIFFUtils, that does this job, even if limited to the tags we
were interested in.
If only a part of the image is needed for display,
only that part is loaded into memory. If the whole image is needed for
display, it is obviously fully loaded in memory, and in this case there
will be no more reading operations on it (unless the actual cell data
are requested).
The RasterImageIO class includes also a writeImage()
method, that writes GeoTIFF files (with TFW, just in case).
There is a
new Metadata class to store basic information about rasters: envelope,
columns and rows, cell size, no data value, some statistics (min, max,
average, standard deviation). These values are calculated on the entire
image, also when only a portion of the image is loaded and
displayed.
Since we've made so many changes, we didn't feel like
pushing them up to SVN. Instead, we've made a new openjump.jar for you
to try, modifying the source code downloaded from SVN (you can find the
jar here [1]). You can replace it to the OpenJUMP.jar of the latest
stable release, provided you also replace the default-plugins.xml with
this one [2] (that accounts for the macro plugin).
Instead, if you want
to check the source code, here [3]you can find all the modified
classes.
We've made some test to check against memory leaks, and it
appears that all the references to images are released when an image is
removed from the project. We've not completed the debugging yet, before
spending more time on it we'd like to know what's your opinion.
Let us
know
Alberto
Links:
------
[1]
https://www.dropbox.com/s/f2xi7j307jzxwqm/OpenJUMP.jar?dl=0
[2]
https://www.dropbox.com/s/equnejnc1c8agcq/default-plugins.xml?dl=0
[3]
https://www.dropbox.com/s/sxqo96rh8jtan0k/Modified.7z?dl=0
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel