comparison flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java @ 4994:63617e142dfe

Quick-fix for floodmaps. Use the correct projection for DGM. * Added projection for DGM to floodmap.xml. * Use DGM projection to create axis.shp and qps.shp. * Write DGM projection to wsplgen layer mapfile.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 15 Feb 2013 10:56:08 +0100
parents dc0d37715e16
children
comparison
equal deleted inserted replaced
4990:eee722bc85da 4994:63617e142dfe
70 Pattern.compile("\\D*(\\d++.\\d*)\\D*"); 70 Pattern.compile("\\D*(\\d++.\\d*)\\D*");
71 71
72 public static final String XPATH_FLOODMAP_RIVER_PROJECTION = 72 public static final String XPATH_FLOODMAP_RIVER_PROJECTION =
73 "/artifact-database/floodmap/river[@name=$name]/srid/@value"; 73 "/artifact-database/floodmap/river[@name=$name]/srid/@value";
74 74
75 public static final String XPATH_FLOODMAP_DGM_PROJECTION =
76 "/artifact-database/floodmap/river[@name=$name]/dgm-srid/@value";
77
75 public static final String XPATH_FLOODMAP_SHAPEFILE_DIR = 78 public static final String XPATH_FLOODMAP_SHAPEFILE_DIR =
76 "/artifact-database/floodmap/shapefile-path/@value"; 79 "/artifact-database/floodmap/shapefile-path/@value";
77 80
78 public static final String XPATH_FLOODMAP_VELOCITY_LOGFILE = 81 public static final String XPATH_FLOODMAP_VELOCITY_LOGFILE =
79 "/artifact-database/floodmap/velocity/logfile/@path"; 82 "/artifact-database/floodmap/velocity/logfile/@path";
414 XPathConstants.STRING, 417 XPathConstants.STRING,
415 null, 418 null,
416 variables); 419 variables);
417 } 420 }
418 421
422 public static String getRiverDGMSrid(String rivername) {
423 Map<String, String> variables = new HashMap<String, String>(1);
424 variables.put("name", rivername);
425
426 Document cfg = Config.getConfig();
427
428 String dgm = (String) XMLUtils.xpath(
429 cfg,
430 XPATH_FLOODMAP_DGM_PROJECTION,
431 XPathConstants.STRING,
432 null,
433 variables);
434 if (logger.isDebugEnabled()) {
435 logger.debug("Use EPSG:" + dgm + " for DGM");
436 }
437 return dgm;
438 }
419 439
420 /** 440 /**
421 * Return the (first) Gauge corresponding to the given location(s) of 441 * Return the (first) Gauge corresponding to the given location(s) of
422 * the artifact. 442 * the artifact.
423 * @param flys the artifact in question. 443 * @param flys the artifact in question.

http://dive4elements.wald.intevation.org