History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GEOT-1617
Type: Improvement Improvement
Status: In Progress In Progress
Priority: Major Major
Assignee: Simone Giannecchini
Reporter: Jaroslav Kubos
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
GeoTools

Rendering of rotated tiled coverages

Created: 11/Dec/07 08:19 AM   Updated: 17/Apr/08 07:36 AM
Component/s: core render
Affects Version/s: None
Fix Version/s: None

Environment: windows, solaris, 64MB heap size, any big enough image with world file with nonzero second and third line


 Description  « Hide
Hi all. We are trying to render huge (21000x21000px) GeoTiff which is internally tiled and contain overviews. It is created from image and worldfile by GDAL. When it is not rotated ("rotation term" field for row and column in worldfile) everything works fine, memory consumption is small. But in case it is rotated, rendering takes big amount of memory. I debugged it and the problem is in "GridCoverageRenderer" in method "paint":

Because image is rotated this condition will pass
– if(!isScaleTranslate(gridCoverage.getGridGeometry().getGridToCRS())) {

then because we render in one CRS this condition will not pass
– if (doReprojection) {

then is called
– graphics.drawRenderedImage(finalImage, clonedFinalWorldToGrid);

which will fail on "Java heap space OutOfMemory Error". Because (Java documentation):
– Renders a RenderedImage, applying a transform from image space into user space before drawing.

So one possible solution is to use gdalwarp utility to remove rotation from image. That is how we work now.

Second possibility is to improve geotools way of rendering tiled rotated coverages. The improvement could be to render each tile inside rendering bbox separately. It will be probably quite slow but better than exception.

If you want I think I am able to implement this feature. Though some hints about classes/methods I should use could be helpful.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Jody Garnett - 11/Dec/07 04:57 PM
Sounds like an interesting problem; if you are willing a patch for the module maintainer to review would be very cool. After a couple such code reviews the module maintainer can also recommend you for commit access.

Jody Garnett - 11/Dec/07 04:58 PM
Simone I am going to assign this one to you - the magic in this method is more up your alley.