[PATCH 1 of 2] Control directory where axis mapfiles are written

Wald Commits scm-commit at wald.intevation.org
Thu Dec 24 19:05:53 CET 2015


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1450975722 -3600
# Node ID a58cbb1b7371b0b66980fb5a7e7343305579312c
# Parent  dece88059a36bdd62e998b91fa74be4fd55555ef
Control directory where axis mapfiles are written.

Is assumed to be conf/.. but was working directory of server.

diff -r dece88059a36 -r a58cbb1b7371 artifacts/src/main/java/org/dive4elements/river/utils/RiverMapfileGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverMapfileGenerator.java	Tue Dec 22 11:22:06 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverMapfileGenerator.java	Thu Dec 24 17:48:42 2015 +0100
@@ -11,6 +11,8 @@
 import com.vividsolutions.jts.geom.Envelope;
 import com.vividsolutions.jts.geom.MultiLineString;
 
+import org.dive4elements.artifacts.common.utils.Config;
+
 import org.dive4elements.river.artifacts.model.LayerInfo;
 import org.dive4elements.river.artifacts.model.RiverFactory;
 
@@ -121,7 +123,9 @@
         layerInfo.setFilter("river_id = " + riverID + " and kind_id = 1");
         layerInfo.setTitle(riverName + " RiverAxis");
 
-        File layerFile = new File("river-" + riverName + ".map");
+        File layerFile = new File(
+            Config.getConfigDirectory().getParentFile(),
+            "river-" + riverName + ".map");
         Template template = getTemplateByName("riveraxis-layer.vm");
         if (template == null) {
             log.warn("Template riveraxis-layer.vm not found.");


More information about the Dive4Elements-commits mailing list