From: Artur H. <ko...@us...> - 2001-11-21 13:48:23
|
Update of /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/ogc In directory usw-pr-cvs1:/tmp/cvs-serv13012/uk/ac/leeds/ccg/ogc Modified Files: RemoteOGC.java WMSLayer.java WebServiceLayer.java Log Message: Added support for creating ImageLayer with InputStream as image data source and full support for downaloding map data from WMS with jprotocols package Index: RemoteOGC.java =================================================================== RCS file: /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/ogc/RemoteOGC.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RemoteOGC.java 2001/11/20 17:01:45 1.15 --- RemoteOGC.java 2001/11/21 13:48:19 1.16 *************** *** 160,170 **** for (int i=0;i<params.length;i+=2) { if(params[i]==null||params[i+1]==null) continue; ! serverURL.append("&" + URLEncoder.encode(params[i]) ! + "=" + URLEncoder.encode(params[i+1])); } try { if (this.proxy != null) { ! newURL = new URL(this.proxy + "?ProxyURL=" + ! URLEncoder.encode(serverURL.toString())); } else { newURL = new URL(serverURL.toString()); --- 160,172 ---- for (int i=0;i<params.length;i+=2) { if(params[i]==null||params[i+1]==null) continue; ! serverURL.append("&" + params[i] + "=" + params[i+1]); ! // serverURL.append("&" + URLEncoder.encode(params[i]) ! // + "=" + URLEncoder.encode(params[i+1])); } try { if (this.proxy != null) { ! newURL = new URL(this.proxy + "?ProxyURL=" + serverURL.toString()); ! // newURL = new URL(this.proxy + "?ProxyURL=" + ! // URLEncoder.encode(serverURL.toString())); } else { newURL = new URL(serverURL.toString()); *************** *** 195,198 **** --- 197,217 ---- } + public InputStream getImageStream(String[] params) + { + URL url = this.getURL(params); + InputStream instr = null; + try { + if (remoteConnection == null) { + initConnection(); + } // end of if (remoteConnection == null) + + int res = remoteConnection.sendRequest(url); + instr = remoteConnection.getInputStream(); + } catch (IOException e) { + instr = null; + } // end of try-catch + return instr; + } + /* ********* <code>WebMapService</code> proxy methods START *********** */ *************** *** 356,359 **** --- 375,381 ---- * * $Log$ + * Revision 1.16 2001/11/21 13:48:19 kobit + * Added support for creating ImageLayer with InputStream as image data source and full support for downaloding map data from WMS with jprotocols package + * * Revision 1.15 2001/11/20 17:01:45 kobit * Added byte[] getContentData() support Index: WMSLayer.java =================================================================== RCS file: /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/ogc/WMSLayer.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** WMSLayer.java 2001/11/20 17:01:45 1.25 --- WMSLayer.java 2001/11/21 13:48:19 1.26 *************** *** 30,33 **** --- 30,34 ---- import java.awt.image.*; import java.awt.*; + import java.io.InputStream; /** *************** *** 118,123 **** * particular, extent). */ ! public Layer buildLayer( ! GeoGraphics gg) { // ImageLayer imageLayer; --- 119,123 ---- * particular, extent). */ ! public Layer buildLayer(GeoGraphics gg) { // ImageLayer imageLayer; *************** *** 137,151 **** "EXCEPTIONS",this.exceptionFormat }; ! byte[] imageData = remoteWMS.getImageData(params); ! if (imageData != null) { ! System.out.println("Image data size is: "+imageData.length); ! Image img = Toolkit.getDefaultToolkit().createImage(imageData); ! return new ImageLayer(img, extent); } // end of if (imageData != null) else { return null; } // end of if (imageData != null)else - // Image img = Toolkit.getDefaultToolkit().createImage(remoteWMS.getURL(params)); - // return new ImageLayer(img, extent); // url = this.remoteWMS.getURL(params); // return new ImageLayer(url,extent); --- 137,147 ---- "EXCEPTIONS",this.exceptionFormat }; ! InputStream instr = remoteWMS.getImageStream(params); ! if (instr != null) { ! return new ImageLayer(instr, extent); } // end of if (imageData != null) else { return null; } // end of if (imageData != null)else // url = this.remoteWMS.getURL(params); // return new ImageLayer(url,extent); *************** *** 168,171 **** --- 164,171 ---- * * $Log$ + * Revision 1.26 2001/11/21 13:48:19 kobit + * Added support for creating ImageLayer with InputStream as image data source and full support for downaloding map data from WMS with jprotocols package + * + * * Revision 1.25 2001/11/20 17:01:45 kobit * Added byte[] getContentData() support Index: WebServiceLayer.java =================================================================== RCS file: /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/ogc/WebServiceLayer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebServiceLayer.java 2001/10/24 09:40:18 1.4 --- WebServiceLayer.java 2001/11/21 13:48:19 1.5 *************** *** 52,57 **** * @param gg Information (mainly extent) required for building a new layer. */ ! public abstract Layer buildLayer( ! GeoGraphics gg); --- 52,56 ---- * @param gg Information (mainly extent) required for building a new layer. */ ! public abstract Layer buildLayer(GeoGraphics gg); *************** *** 173,176 **** --- 172,178 ---- * * $Log$ + * Revision 1.5 2001/11/21 13:48:19 kobit + * Added support for creating ImageLayer with InputStream as image data source and full support for downaloding map data from WMS with jprotocols package + * * Revision 1.4 2001/10/24 09:40:18 kobit * Added LOG cvs keyword to the end of file |