Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/RasterLayerReader.java @ 306:ea3fde77ea48
Catch generic Exceptions to avoid leaking them and creating
silent errors
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 06 Sep 2012 18:56:20 +0200 |
parents | a9684178cb29 |
children | f9e53dcc7424 |
rev | line source |
---|---|
303
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
1 /* |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH, Germany <info@intevation.de> |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
3 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
4 * This file is part of MXD2map. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
5 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
6 * This program is free software under the LGPL (>=v2.1) |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
7 * Read the file LICENCE.txt coming with the software for details |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 * or visit http://www.gnu.org/licenses/ if it does not exist. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 * MXD2map has been developed on behalf of the |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 * Bundesamt fuer Seeschifffahrt und Hydrographie (BSH) in Hamburg |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 * by Intevation GmbH. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
13 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 * Authors: |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 * Raimund Renkert <raimund.renkert@intevation.de> |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 * Bjoern Schilberg <bjoern.schilberg@intevation.de> |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
17 * Stephan Holl <stephan.holl@intevation.de> |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 */ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
20 package de.intevation.mxd.reader; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
21 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
22 import org.apache.log4j.Logger; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
23 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
24 import com.esri.arcgis.carto.ILayer; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
25 import com.esri.arcgis.carto.RasterLayer; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
26 import com.esri.arcgis.carto.AnnotateLayerPropertiesCollection; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
27 import com.esri.arcgis.carto.IAnnotateLayerProperties; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
28 import com.esri.arcgis.carto.LabelEngineLayerProperties; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
29 import com.esri.arcgis.geodatabase.RasterDatasetName; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
30 import com.esri.arcgis.system.IName; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
31 import com.esri.arcgis.system.IPropertySet; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
32 import com.esri.arcgis.geometry.Envelope; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
33 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
34 import org.w3c.dom.Element; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
35 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
36 import de.intevation.mxd.utils.MapToXMLUtils; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
37 import java.io.IOException; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
38 import com.esri.arcgis.interop.AutomationException; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
39 /** |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
40 * Reads Layer information. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
41 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
42 * @author <a href="mailto:aheinecke@intevation.de">Andre Heinecke</a> |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
43 */ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
44 public class RasterLayerReader |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
45 implements ILayerReader { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
46 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
47 /** |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
48 * The logger. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
49 */ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
50 private static final Logger logger = |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
51 Logger.getLogger(RasterLayerReader.class); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
52 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
53 /** |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
54 * Privte member. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
55 */ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
56 private RasterLayer layer; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
57 private MapToXMLUtils util; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
58 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
59 /** |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
60 * Constructor with layer. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
61 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
62 * @param layer The ArcGIS layer object. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
63 */ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
64 public RasterLayerReader(ILayer layer) |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
65 throws Exception { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
66 if(layer instanceof RasterLayer) { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
67 this.layer = (RasterLayer)layer; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
68 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
69 else { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
70 throw new Exception("Not an instance of RasterLayer: " + |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
71 layer.getClass().toString()); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
72 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
73 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
74 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
75 /** |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
76 * Setter for XML document helper. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
77 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
78 * @param util The helper for storing map information. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
79 */ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
80 public void setUtil(MapToXMLUtils util) { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
81 this.util = util; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
82 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
83 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
84 /** |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
85 * Reads the Layer content. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
86 * |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
87 * @return The layer XML element. |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
88 */ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
89 public Element read() |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
90 throws IOException{ |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
91 logger.debug("read()"); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
92 Element layerElement; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
93 try { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
94 layerElement = util.addLayer(); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
95 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
96 catch(Exception e) { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
97 logger.error("Failed to create DOM-Element for Layer."); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
98 return null; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
99 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
100 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
101 try { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
102 layerElement.setAttribute("name", layer.getName()); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
103 } |
306
ea3fde77ea48
Catch generic Exceptions to avoid leaking them and creating
Andre Heinecke <aheinecke@intevation.de>
parents:
303
diff
changeset
|
104 catch(Exception e) { |
303
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
105 logger.warn( |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
106 "Could not read layer name." + |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
107 " Stopped reading layer."); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
108 throw new IOException("Error reading layer name."); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
109 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
110 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
111 try { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
112 layerElement.setAttribute("min_scale", |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
113 String.valueOf(layer.getMinimumScale())); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
114 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
115 catch(IOException ioe) { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
116 logger.warn("Could not read minimum scale."); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
117 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
118 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
119 try { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
120 layerElement.setAttribute("max_scale", |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
121 String.valueOf(layer.getMaximumScale())); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
122 } |
306
ea3fde77ea48
Catch generic Exceptions to avoid leaking them and creating
Andre Heinecke <aheinecke@intevation.de>
parents:
303
diff
changeset
|
123 catch(Exception e) { |
303
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
124 logger.warn( |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
125 "Could not read maximum scale."); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
126 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
127 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
128 try { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
129 if(layer.isVisible()) { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
130 layerElement.setAttribute("status", "on"); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
131 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
132 else { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
133 layerElement.setAttribute("status", "off"); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
134 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
135 } |
306
ea3fde77ea48
Catch generic Exceptions to avoid leaking them and creating
Andre Heinecke <aheinecke@intevation.de>
parents:
303
diff
changeset
|
136 catch(Exception e) { |
303
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
137 logger.warn( |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
138 "Could not read layer status." + |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
139 " Setting layer status to \"on\"."); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
140 layerElement.setAttribute("status", "on"); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
141 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
142 try { |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
143 layerElement.setAttribute("data_source", layer.getFilePath()); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
144 } |
306
ea3fde77ea48
Catch generic Exceptions to avoid leaking them and creating
Andre Heinecke <aheinecke@intevation.de>
parents:
303
diff
changeset
|
145 catch(Exception e) { |
303
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
146 logger.warn( |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
147 "Could not read datasource." + |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
148 " Stopped reading layer " + layer.getName() + "."); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
149 util.removeLayer(layerElement); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
150 return null; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
151 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
152 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
153 // Static Attributes for Raster: |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
154 layerElement.setAttribute("type", "raster"); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
155 layerElement.setAttribute("connection_type", "local"); |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
156 |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
157 return layerElement; |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
158 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
159 } |
a9684178cb29
Add RasterLayer Reader
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
160 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |