comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 152:8a87c796bf47

Fixed expression for the first min value.
author vc11884admin@VC11884.win.bsh.de
date Thu, 30 Jun 2011 13:48:09 +0200
parents 2bf35f0babd0
children 7ed49420ee5a
comparison
equal deleted inserted replaced
151:1623c8c99135 152:8a87c796bf47
270 name += "-" + i; 270 name += "-" + i;
271 } 271 }
272 } 272 }
273 co.setName (name); 273 co.setName (name);
274 if(classElement.hasAttribute("field_count")) { 274 if(classElement.hasAttribute("field_count")) {
275 co.setExpression(createExpression(classElement)); 275 co.setExpression(createExpression(classElement, i));
276 } 276 }
277 //Write symbols and styles. 277 //Write symbols and styles.
278 NodeList l = classElement.getChildNodes(); 278 NodeList l = classElement.getChildNodes();
279 for (int j = l.getLength() - 1; j >= 0; j--) { 279 for (int j = l.getLength() - 1; j >= 0; j--) {
280 Element elem = (Element)l.item(j); 280 Element elem = (Element)l.item(j);
295 } 295 }
296 } 296 }
297 } 297 }
298 298
299 299
300 private String createExpression(Element ce) { 300 private String createExpression(Element ce, int index) {
301 String expression = "("; 301 String expression = "(";
302 int count = 0; 302 int count = 0;
303 try { 303 try {
304 count = Integer.parseInt(ce.getAttribute("field_count")); 304 count = Integer.parseInt(ce.getAttribute("field_count"));
305 } 305 }
315 pre = prefix + "."; 315 pre = prefix + ".";
316 } 316 }
317 expression += "[" + pre; 317 expression += "[" + pre;
318 expression += ce.getAttribute("expression_field_0") + "]"; 318 expression += ce.getAttribute("expression_field_0") + "]";
319 if(ce.hasAttribute("min_value")) { 319 if(ce.hasAttribute("min_value")) {
320 expression += " > " + ce.getAttribute("min_value"); 320 if(index == 0) {
321 expression += " >= " + ce.getAttribute("min_value");
322 }
323 else {
324 expression += " > " + ce.getAttribute("min_value");
325 }
321 expression += " AND ["; 326 expression += " AND [";
322 expression += ce.getAttribute("expression_field_0")+ "]"; 327 expression += ce.getAttribute("expression_field_0")+ "]";
323 } 328 }
324 expression += " " + ce.getAttribute("expression_operator"); 329 expression += " " + ce.getAttribute("expression_operator");
325 expression += " " + ce.getAttribute("value") + ")"; 330 expression += " " + ce.getAttribute("value") + ")";
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)