comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 145:b2c5a66022f1

Exception handling for number conversions in writer modules.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 27 Jun 2011 18:22:21 +0200
parents 8f30f7e802d6
children 2bf35f0babd0
comparison
equal deleted inserted replaced
144:ad3f540fd1c3 145:b2c5a66022f1
161 else { 161 else {
162 layer.setStatus(0); 162 layer.setStatus(0);
163 } 163 }
164 164
165 //The scale. 165 //The scale.
166 double maxScale = 166 double maxScale = 0;
167 Double.parseDouble(layerElement.getAttribute("max_scale")); 167 double minScale = 0;
168 double minScale = 168 try {
169 Double.parseDouble(layerElement.getAttribute("min_scale")); 169 maxScale =
170 Double.parseDouble(layerElement.getAttribute("max_scale"));
171 minScale =
172 Double.parseDouble(layerElement.getAttribute("min_scale"));
173 }
174 catch(NumberFormatException nfe) {
175 logger.warn("Error setting scale.");
176 maxScale = 0;
177 minScale = 0;
178 }
170 layer.setMaxscaledenom(maxScale); 179 layer.setMaxscaledenom(maxScale);
171 layer.setMinscaledenom(minScale); 180 layer.setMinscaledenom(minScale);
172 181
173 //The layer type. 182 //The layer type.
174 String type = layerElement.getAttribute("type"); 183 String type = layerElement.getAttribute("type");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)