Strabon

changeset 261:a4dadade7e30

pass by exception for geometry searching. remove string creation with results. add tr in kml
author George Garbis <ggarbis@di.uoa.gr>
date Wed Jun 06 16:49:05 2012 +0300 (2012-06-06)
parents 7fe20134c3b3
children eaef3863cd22
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed Jun 06 13:59:24 2012 +0300
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed Jun 06 16:49:05 2012 +0300
     1.3 @@ -535,7 +535,7 @@
     1.4  										sb.append("</td>");
     1.5  									}
     1.6  								}
     1.7 -								sb.append("</table>]]>");
     1.8 +								sb.append("</tr></table>]]>");
     1.9  							}
    1.10  							else
    1.11  							{
    1.12 @@ -551,7 +551,7 @@
    1.13  
    1.14  						} catch (ParseException e) {
    1.15  							// this is not WKT
    1.16 -							logger.error("[Strabon.query] Invalid WKT.", e);
    1.17 +							// this exception is not error! pass by thematic values and keep searching for geometries  
    1.18  						} catch (Exception e) {
    1.19  							logger.error("[Strabon.query] Received exception during KML construction.", e);
    1.20  						}
    1.21 @@ -602,11 +602,13 @@
    1.22  
    1.23  			try {
    1.24  				//String cstr = new String("aa", "UTF8");
    1.25 -				String newString = new String(sb.toString().getBytes(), Charset.availableCharsets().get("UTF-8"));
    1.26 +				// ggarbis: For too large strings (e.g., 44MB) it returns empty string.
    1.27 +//				String newString = new String(sb.toString().getBytes(), Charset.availableCharsets().get("UTF-8"));
    1.28  
    1.29  				if(resultsFormat.equalsIgnoreCase("KML"))
    1.30  				{
    1.31 -					writeOut.write(newString);
    1.32 +//					writeOut.write(newString);
    1.33 +					writeOut.write(sb.toString());
    1.34  					//					System.out.println(newString);
    1.35  				}
    1.36  				else //KMZ
    1.37 @@ -621,7 +623,8 @@
    1.38  
    1.39  					//kmzout.setLevel(6);
    1.40  					kmzout.putNextEntry(entry);
    1.41 -					kmzout.write(newString.getBytes());
    1.42 +//					kmzout.write(newString.getBytes());
    1.43 +					kmzout.write(sb.toString().getBytes());
    1.44  					kmzout.closeEntry();
    1.45  					kmzout.close();
    1.46