Creating big images

View: New views
4 Messages — Rating Filter:   Alert me  

Creating big images

by jai-interest-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, I want to create really big images using JAI, which I will finally write to GeoTiff or ArcGRID by using GeoTools.

In order to write the image with GeoTools, I need a Raster or an Image object. I usually use something like this to create the raster:

Raster m_Raster = RasterFactory.createBandedRaster(DataBuffer.TYPE_FLOAT,
                                        60000, 60000, 1, null);

In this way, I can later use this Raster to actually write to disk by using GeoTools.

However, when I use so big sizes, I get the following exception:

java.lang.IllegalArgumentException: Size of array must be smaller than Integer.MAX_VALUE.
at javax.media.jai.RasterFactory.createBandedRaster(RasterFactory.java:307)
....

So I see this is not a valid option to create big images... Is there another option to create a big Raster or Image object with JAI?

Thanks in advance,

César
[Message sent by forum member 'dispiste' (cesar.izq@...)]

http://forums.java.net/jive/thread.jspa?messageID=369971

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Creating big images

by Bob Deen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You have to tile the image... so each individual tile (represented by a
Raster) is within the size limit.  You can also structure it so that
only one or a few tiles need to be in memory at once, which greatly
helps with the memory footprint.  There are mechanisms to retrieve tiles
on demand for that purpose.  If you really have the memory though, you
can also create all the tiles at once.  In either case, the API
generally works as well with tiled images as it does with untiled.
(that's not *always* the case, but generally it does).

Hope that helps...

-Bob

jai-interest@... wrote:

> Hello, I want to create really big images using JAI, which I will finally write to GeoTiff or ArcGRID by using GeoTools.
>
> In order to write the image with GeoTools, I need a Raster or an Image object. I usually use something like this to create the raster:
>
> Raster m_Raster = RasterFactory.createBandedRaster(DataBuffer.TYPE_FLOAT,
> 60000, 60000, 1, null);
>
> In this way, I can later use this Raster to actually write to disk by using GeoTools.
>
> However, when I use so big sizes, I get the following exception:
>
> java.lang.IllegalArgumentException: Size of array must be smaller than Integer.MAX_VALUE.
> at javax.media.jai.RasterFactory.createBandedRaster(RasterFactory.java:307)
> ....
>
> So I see this is not a valid option to create big images... Is there another option to create a big Raster or Image object with JAI?
>
> Thanks in advance,
>
> César
> [Message sent by forum member 'dispiste' (cesar.izq@...)]
>
> http://forums.java.net/jive/thread.jspa?messageID=369971
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@...
> For additional commands, e-mail: interest-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Creating big images

by jai-interest-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<shameless-plug>
In addition to Bob's comments, there is also the DiskMemImage class in jai-tools. It's a tiled image that can use supplement memory storage of tiles with disk caching to handle large volumes of data:
http://code.google.com/p/jai-tools/wiki/DiskMemImage
</shameless-plug>

Michael
[Message sent by forum member 'cafeanimal' (michael.bedward@...)]

http://forums.java.net/jive/thread.jspa?messageID=370398

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Creating big images

by jai-interest-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Bob,

I don't need to create it on memory, but I need a raster of this size in order to create the coverage in GeoTools (at least, as far as I know). I think I can use Michael's DiskMemImage to achieve this... I'm currently testing it.

Thanks for your replies.


Regards,

César
[Message sent by forum member 'dispiste' (cesar.izq@...)]

http://forums.java.net/jive/thread.jspa?messageID=370669

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...