Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/CompositeGraphicsLayerReader.java @ 319:5ea3abee729d
Remove unecessary debug output
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 20 Sep 2012 12:58:21 +0200 |
parents | 1d77ea6a915d |
children | b6c0fbae16dc |
rev | line source |
---|---|
315
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
1 /* |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
2 * Copyright (c) 2012 by Intevation GmbH, Germany <info@intevation.de> |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
3 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
4 * This file is part of MXD2map. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
5 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
6 * This program is free software under the LGPL (>=v2.1) |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
7 * Read the file LICENCE.txt coming with the software for details |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 * or visit http://www.gnu.org/licenses/ if it does not exist. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 * MXD2map has been developed on behalf of the |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 * Bundesamt fuer Seeschifffahrt und Hydrographie (BSH) in Hamburg |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 * by Intevation GmbH. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
13 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 * Authors: |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 * Raimund Renkert <raimund.renkert@intevation.de> |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 * Bjoern Schilberg <bjoern.schilberg@intevation.de> |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
17 * Stephan Holl <stephan.holl@intevation.de> |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 * Andre Heinecke <aheinecke@intevation.de> |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 */ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
20 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
21 package de.intevation.mxd.reader; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
22 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
23 import org.apache.log4j.Logger; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
24 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
25 import com.esri.arcgis.carto.IGraphicsLayer; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
26 import com.esri.arcgis.carto.CompositeGraphicsLayer; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
27 import com.esri.arcgis.carto.AnnotateLayerPropertiesCollection; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
28 import com.esri.arcgis.carto.IAnnotateLayerProperties; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
29 import com.esri.arcgis.carto.LabelEngineLayerProperties; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
30 import com.esri.arcgis.carto.IElement; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
31 import com.esri.arcgis.carto.TextElement; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
32 import com.esri.arcgis.system.IName; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
33 import com.esri.arcgis.system.IPropertySet; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
34 import com.esri.arcgis.geometry.Envelope; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
35 import com.esri.arcgis.geometry.ISpatialReference; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
36 import com.esri.arcgis.geometry.ProjectedCoordinateSystem; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
37 import com.esri.arcgis.geometry.GeographicCoordinateSystem; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
38 import com.esri.arcgis.geometry.UnknownCoordinateSystem; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
39 import com.esri.arcgis.geometry.Projection; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
40 import com.esri.arcgis.geometry.IPoint; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
41 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
42 import com.esri.arcgis.display.ITextSymbol; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
43 import com.esri.arcgis.display.TextSymbol; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
44 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
45 import org.w3c.dom.Element; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
46 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
47 import de.intevation.mxd.utils.MapToXMLUtils; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
48 import java.io.IOException; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
49 import com.esri.arcgis.interop.AutomationException; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
50 /** |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
51 * Reads Layer information. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
52 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
53 * @author <a href="mailto:aheinecke@intevation.de">Andre Heinecke</a> |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
54 */ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
55 public class CompositeGraphicsLayerReader |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
56 implements ILayerReader { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
57 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
58 /** |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
59 * The logger. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
60 */ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
61 private static final Logger logger = |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
62 Logger.getLogger(CompositeGraphicsLayerReader.class); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
63 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
64 /** |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
65 * Privte member. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
66 */ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
67 private CompositeGraphicsLayer layer; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
68 private MapToXMLUtils util; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
69 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
70 /** |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
71 * Constructor with layer. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
72 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
73 * @param layer The ArcGIS layer object. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
74 */ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
75 public CompositeGraphicsLayerReader(IGraphicsLayer layer) |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
76 throws Exception { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
77 if(layer instanceof CompositeGraphicsLayer) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
78 this.layer = (CompositeGraphicsLayer)layer; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
79 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
80 else { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
81 throw new Exception("Not an instance of CompositeGraphicsLayer: " + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
82 layer.getClass().toString()); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
83 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
84 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
85 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
86 /** |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
87 * Setter for XML document helper. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
88 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
89 * @param util The helper for storing map information. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
90 */ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
91 public void setUtil(MapToXMLUtils util) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
92 this.util = util; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
93 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
94 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
95 /** |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
96 * Reads the Layer content. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
97 * |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
98 * @return The layer XML element. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
99 */ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
100 public Element read() |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
101 throws IOException{ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
102 logger.debug("read()"); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
103 Element layerElement = null; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
104 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
105 layerElement = util.addLayer(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
106 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
107 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
108 logger.error("Failed to create DOM-Element for Layer."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
109 return null; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
110 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
111 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
112 // Name |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
113 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
114 layerElement.setAttribute("name", layer.getName()); |
319
5ea3abee729d
Remove unecessary debug output
Andre Heinecke <aheinecke@intevation.de>
parents:
315
diff
changeset
|
115 |
315
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
116 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
117 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
118 logger.warn( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
119 "Could not read layer name." + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
120 " Stopped reading layer."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
121 throw new IOException("Error reading layer name."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
122 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
123 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
124 // Scale |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
125 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
126 layerElement.setAttribute("min_scale", |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
127 String.valueOf(layer.getMinimumScale())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
128 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
129 catch(IOException ioe) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
130 logger.warn("Could not read minimum scale."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
131 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
132 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
133 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
134 layerElement.setAttribute("max_scale", |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
135 String.valueOf(layer.getMaximumScale())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
136 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
137 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
138 logger.warn( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
139 "Could not read maximum scale."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
140 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
141 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
142 // Status |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
143 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
144 if(layer.isVisible()) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
145 layerElement.setAttribute("status", "on"); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
146 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
147 else { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
148 layerElement.setAttribute("status", "off"); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
149 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
150 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
151 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
152 logger.warn( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
153 "Could not read layer status." + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
154 " Setting layer status to \"on\"."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
155 layerElement.setAttribute("status", "on"); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
156 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
157 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
158 // Extent |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
159 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
160 Envelope rect = (Envelope)layer.getExtent(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
161 layerElement.setAttribute( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
162 "extent_min_x", |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
163 String.valueOf(rect.getXMin ())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
164 layerElement.setAttribute( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
165 "extent_max_x", |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
166 String.valueOf(rect.getXMax())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
167 layerElement.setAttribute( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
168 "extent_min_y", |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
169 String.valueOf(rect.getYMin())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
170 layerElement.setAttribute( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
171 "extent_max_y", |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
172 String.valueOf(rect.getYMax())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
173 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
174 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
175 logger.warn( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
176 "Could not read extent from layer " |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
177 + layer.getName() + "."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
178 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
179 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
180 // Read the elements |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
181 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
182 int count = 0; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
183 IElement actElement = null; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
184 IElement prevElement = null; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
185 layer.reset(); // Reset the element container |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
186 actElement = layer.next(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
187 while (actElement != prevElement) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
188 prevElement = actElement; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
189 if (actElement instanceof TextElement) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
190 TextElement te = (TextElement)actElement; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
191 Element xmlTextElement = util.addFeature(layerElement); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
192 xmlTextElement.setAttribute("text", te.getText()); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
193 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
194 IPoint poi = te.getGeometry().getEnvelope().getLowerLeft(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
195 xmlTextElement.setAttribute("X", String.valueOf(poi.getX())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
196 xmlTextElement.setAttribute("Y", String.valueOf(poi.getY())); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
197 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
198 logger.debug("Text: " + te.getText()); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
199 logger.debug(" X,Y: " + poi.getX() + ", " + poi.getY()); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
200 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
201 ITextSymbol sym = te.getSymbol(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
202 if(sym instanceof TextSymbol) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
203 TextSymbolReader tsr = new TextSymbolReader(sym); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
204 tsr.setParent(xmlTextElement); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
205 tsr.setUtil(util); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
206 tsr.read(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
207 } else { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
208 logger.warn("Unknwon Symbol of class: " + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
209 sym.getClass().toString()); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
210 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
211 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
212 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
213 logger.warn("Could not read element text symbol."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
214 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
215 } else { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
216 logger.warn("Unhandled Element of class: " + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
217 actElement.getClass().toString() + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
218 " in conversion of layer: " + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
219 layer.getName()); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
220 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
221 count++; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
222 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
223 logger.debug("Read " + count + " Elements"); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
224 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
225 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
226 logger.warn("Could not read layer elements."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
227 logger.debug(e); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
228 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
229 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
230 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
231 //Read the projection. |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
232 try { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
233 ISpatialReference sr = layer.getSpatialReference(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
234 int projection = 0; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
235 if(sr instanceof ProjectedCoordinateSystem) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
236 ProjectedCoordinateSystem pcs = (ProjectedCoordinateSystem)sr; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
237 projection = pcs.getFactoryCode(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
238 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
239 else if(sr instanceof GeographicCoordinateSystem) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
240 GeographicCoordinateSystem gcs = (GeographicCoordinateSystem)sr; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
241 projection = gcs.getFactoryCode(); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
242 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
243 else if(sr instanceof UnknownCoordinateSystem) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
244 UnknownCoordinateSystem ucs = (UnknownCoordinateSystem)sr; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
245 projection = 0; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
246 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
247 else{ |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
248 logger.debug( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
249 "Unknown SpatialReference: " + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
250 sr.getClass().toString()); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
251 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
252 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
253 if(projection == 0) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
254 logger.warn( |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
255 "Unknown projection for Layer:" + layer.getName() + |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
256 " Please edit projection in resulting mapfile."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
257 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
258 layerElement.setAttribute("projection", String.valueOf(projection)); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
259 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
260 catch(Exception e) { |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
261 logger.warn("Could not read layer projection."); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
262 logger.debug(e); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
263 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
264 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
265 // Static values for this layer |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
266 layerElement.setAttribute("type", "point"); |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
267 |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
268 return layerElement; |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
269 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
270 } |
1d77ea6a915d
Add basic support for Graphics Layers. For now this is restricted
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
271 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |