diff src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java @ 136:7632850b9520

Convert cartographic line template to mapfile pattern.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 23 Jun 2011 13:27:30 +0200
parents a4ab239509f1
children 6d294beb0e59
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java	Wed Jun 22 13:55:22 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java	Thu Jun 23 13:27:30 2011 +0200
@@ -9,6 +9,7 @@
 import com.esri.arcgis.display.CartographicLineSymbol;
 import com.esri.arcgis.display.IRgbColor;
 import com.esri.arcgis.display.RgbColor;
+import com.esri.arcgis.display.Template;
 
 import com.esri.arcgis.display.esriLineCapStyle;
 import com.esri.arcgis.display.esriLineJoinStyle;
@@ -175,6 +176,25 @@
         }
         //TODO Read further attributes depending on the Mapscript functionality:
         //     Template, MarkerSymbol, LineDecorations
+
+        try {
+            Template temp = (Template)symbol.getTemplate();
+            double length = temp.getInterval();
+            int count = temp.getPatternElementCount();
+            symbolElement.setAttribute("pattern_count", String.valueOf(count));
+            for (int j = 0; j < count; j++) {
+                double[] mark = new double[1];
+                double[] gap = new double[1];
+                temp.getPatternElement(j, mark, gap);
+                symbolElement.setAttribute(
+                    "mark_" + j,
+                    String.valueOf(mark[0]));
+                symbolElement.setAttribute("gap_" + j, String.valueOf(gap[0]));
+            }
+        }
+        catch(IOException ioe){
+            logger.warn("Could not read pattern elements.");
+        }
         symbolElement.setAttribute("type", "line");
         symbolElement.setAttribute("style", "carto");
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)