On Wed, Jul 11, 2012 at 6:30 PM, Rob Marianski <[email protected]>wrote:

> > If you look into the settings you'll find a threshold at which
> > the current system decides whether to use a memory or a
> > file based imageinputstream (and the same goes for the output).
>
> Just to make sure I'm looking in the right place, these are the jai
> settings in the geoserver admin correct?
>
> http://docs.geoserver.org/stable/en/user/webadmin/server/JAI.html


Nope, it's in "coverage access", the field is "ImageIO cache memory
threshold".


>
>
> > The above system requires image reading/writing code to use
> > the GeoTools ImageIOExt class to get the image input streams,
> > something that the WMSCoverageReader is indeed not doing.
> > That indeed needs fixing, jira + patch welcomed
>
> And the WMSCoverageReader is what handles cascading layers? Does this
> mean that the jai settings mentioned above won't be honored in this
> context currently?
>

Exactly. It's a bug that needs fixing.  The modified code should look
something
like the following:

// issue the request and wrap response in a grid coverage
        ImageInputStream iis = null;
        try {
            if(LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("Issuing request: " + mapRequest.getFinalURL());
            }
            GetMapResponse response = wms.issueRequest(mapRequest);
            try {
                iis =
ImageIOExt.createImageInputStream(response.getInputStream());
                BufferedImage image = ImageIO.read(iis);
                if (image == null) {
                    throw (IOException) new IOException("GetMap failed: "
                            + mapRequest.getFinalURL());
                }
                return gcf.create(layers.get(0).getTitle(), image,
gridEnvelope);
            } finally {
                response.dispose();
            }
        } catch (ServiceException e) {
            throw (IOException) new IOException("GetMap
failed").initCause(e);
        } finally {
            if(iis != null) {
                iis.close();
            }
        }

But I had no time to try that out

Cheres
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
mob:    +39 339 8844549

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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to