Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] custom wms renderer

I have not looked into the handling of raster images for wms. We have added a couple experimental cache options for working with features (and rasters). Perhaps you could create a patch that does what you suggest; saving the image to a temporary file; and then have the renderer display the result.

-- 
Jody Garnett

On Thursday, 21 April 2011 at 11:21 PM, Andrea Aime wrote:

On Thu, Apr 21, 2011 at 8:58 AM, Devrim Baris Acar
<devrimbaris@xxxxxxxxx> wrote:
Hi,
I have developed a custom wms renderer for udig which holds a reference to
the original coverage retrieved from geoserver(raw geotiff crop ).

I have noticed a considerable slowdown as geotiff sizes get bigger (>20
seconds )

I have pinned the problem to be the following lines

----------------------------------------------
inputStream = wms.issueRequest(request).getInputStream();
image[0] = ImageIO.read(inputStream);
----------------------------------------------

Now I have tested with various java codes for streams, command line tools
like "wget", "curl".

Command line tools retrieve the image in nearly 2 seconds.
Java code with buffered streams retrieve image in 20 seconds.


So I have used Apache Commons HTTPClient to retrieve the image, stored in a
file, and let ImageIO stream from the filestream, now the responses are 3-4
seconds, which is much more acceptable.


That leaves the question to how ImageIO.read works in internals .

ImageIO needs random access readers and writers, if you provide a stream
you force it to copy the file in a random access container (either another file
or a byte[] in memory) and decode the images from there, depending
on how ImageIO is configured (by default it will work on a file).

Cheers
Andrea


--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top