comparison src/java/de/intevation/mxd/reader/GdbRasterCatalogLayerReader.java @ 135:a4ab239509f1

Updated the default values and reader error handling.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 22 Jun 2011 13:55:22 +0200
parents 39957898c694
children 0bde090506f9
comparison
equal deleted inserted replaced
134:acc9e5430177 135:a4ab239509f1
66 catch(Exception e) { 66 catch(Exception e) {
67 logger.error( 67 logger.error(
68 "Could not create DOM element for layer." + 68 "Could not create DOM element for layer." +
69 "Stopped reading layer."); 69 "Stopped reading layer.");
70 throw new IOException( 70 throw new IOException(
71 this.getClass()+toString() + 71 this.getClass().toString() +
72 "Error creating dom element"); 72 "Error creating dom element");
73 } 73 }
74 74
75 try { 75 try {
76 layerElement.setAttribute("name", layer.getName()); 76 layerElement.setAttribute("name", layer.getName());
77 } 77 }
78 catch(IOException ioe) { 78 catch(IOException ioe) {
79 logger.warn( 79 logger.warn("Could not read layer name. Stopped reading layer.");
80 "Could not read layer name. " + 80 throw new IOException("Error reading layer name.");
81 "Setting layer name to \"default\".");
82 layerElement.setAttribute("name", "default");
83 } 81 }
84 82
85 try { 83 try {
86 layerElement.setAttribute("min_scale", 84 layerElement.setAttribute("min_scale",
87 String.valueOf(layer.getMinimumScale())); 85 String.valueOf(layer.getMinimumScale()));
88 } 86 }
89 catch(IOException ioe) { 87 catch(IOException ioe) {
90 logger.warn( 88 logger.warn("Could not read minimum layer scale.");
91 "Could not read minimum layer scale." +
92 "Setting minimum layer scale to 1000");
93 layerElement.setAttribute("min_scale", "1000");
94 } 89 }
95 90
96 try { 91 try {
97 layerElement.setAttribute("max_scale", 92 layerElement.setAttribute("max_scale",
98 String.valueOf(layer.getMaximumScale())); 93 String.valueOf(layer.getMaximumScale()));
99 } 94 }
100 catch(IOException ioe) { 95 catch(IOException ioe) {
101 logger.warn( 96 logger.warn("Could not read maximum layer scale.");
102 "Could not read maximum layer scale." +
103 "Setting maximum layer scale to 1000000");
104 layerElement.setAttribute("max_scale", "1000000");
105 } 97 }
106 98
107 try { 99 try {
108 if(layer.isVisible()) { 100 if(layer.isVisible()) {
109 layerElement.setAttribute("status", "on"); 101 layerElement.setAttribute("status", "on");
123 layerElement.setAttribute("definition_query", 115 layerElement.setAttribute("definition_query",
124 layer.getDefinitionExpression()); 116 layer.getDefinitionExpression());
125 } 117 }
126 catch(IOException ioe) { 118 catch(IOException ioe) {
127 logger.warn( 119 logger.warn(
128 "Could not read layer definition query." + 120 "Could not read layer definition query.");
129 "Setting empty definition query.");
130 layerElement.setAttribute("definition_query", "");
131 } 121 }
132 return layerElement; 122 return layerElement;
133 } 123 }
134 } 124 }
135 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 125 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)