Hi,
The following methods issue the same request to my geoserver instance
(2.0.2).
They request imagery in  geotiff32 format which is a custom format I have
"invented" to carry coverage data over wms. There is a custom bean on
geoserver which I have base on worldwind map producer samples(written by the
talented what_nick).

However the problem is while the first method completes in 2-4 seconds the
second completes 20+ seconds at best.

In my debugging the streaming part in second method seems to be the problem
rather than any Imagery related performance issue.

Any suggestions,
Regards

baris

ps. maybe i should use the geotools list?
BBOX are XXX ed on purpose.


@Test
    public void testElev() {
        try {
            long start = new Date().getTime();
            HttpClient httpclient = new DefaultHttpClient();
            HttpGet httpget = new HttpGet("
http://10.0.0.202:9090/geoserver/wms?SERVICE=WMS&LAYERS=talos%3AwroclawElevationInt&EXCEPTIONS=application/vnd.ogc.se_xml&FORMAT=image/geotiff32&HEIGHT=921&REQUEST=GetMap&WIDTH=1725&BBOX=XXX&STYLES=raster&SRS=EPSG:4326&VERSION=1.1.1<http://10.0.0.202:9090/geoserver/wms?SERVICE=WMS&LAYERS=talos%3AwroclawElevationInt&EXCEPTIONS=application/vnd.ogc.se_xml&FORMAT=image/geotiff32&HEIGHT=921&REQUEST=GetMap&WIDTH=1725&BBOX=17.062,51.184904542508235,17.08032540037065,51.19468500857147&STYLES=raster&SRS=EPSG:4326&VERSION=1.1.1>
");
            HttpResponse response = httpclient.execute(httpget);
            HttpEntity entity = response.getEntity();
            String fileName = "c:\\testplans-"+(start%10)+".tiff";
            FileOutputStream fos = new FileOutputStream(fileName);
            if (entity != null) {
                entity.writeTo(fos);
            }
            fos.close();
            ImageInputStream createImageInputStream =
ImageIO.createImageInputStream(new FileInputStream(fileName));
            BufferedImage read = ImageIO.read(createImageInputStream);
            logDuration(start, "Method 1(HTTPClientTEST)");

        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalStateException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }



    @Test
    public void testWMSGetImage(){
        try {
            WebMapServer wms = new WebMapServer(new URL("
http://10.0.0.202:9090/geoserver/wms?request=getCapabilities";));
            WMSCapabilities capabilities = wms.getCapabilities();
            GetMapRequest request = wms.createGetMapRequest();
            ImageIO.setUseCache(true);
            ImageIO.setCacheDirectory(new File("c:\\cachedir"));
            request.setFormat("image/geotiff32");
            request.setDimensions(1752,921); //sets the dimensions of the
image to be returned from the server
            request.setTransparent(true);
            request.setSRS("EPSG:4326");
            request.setBBox("XXX");

            for ( Layer layer : WMSUtils.getNamedLayers(capabilities) ) {
                if(layer.getName().equals("talos:wroclawElevationInt"))
                  request.addLayer(layer);
                }
            GetMapResponse response = (GetMapResponse)
wms.issueRequest(request);
            BufferedImage image = ImageIO.read(response.getInputStream());

        } catch (ServiceException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
Devrim Baris Acar
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to