Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/MXDReader.java @ 133:6b80d2c7536e
Improved broken layer handling.
author | vc11884admin@VC11884.win.bsh.de |
---|---|
date | Tue, 21 Jun 2011 15:22:06 +0200 |
parents | 9f74f4d36822 |
children | 2bf35f0babd0 |
comparison
equal
deleted
inserted
replaced
132:02df1dbc2166 | 133:6b80d2c7536e |
---|---|
127 try { | 127 try { |
128 if (layer instanceof FeatureLayer) { | 128 if (layer instanceof FeatureLayer) { |
129 FeatureLayerReader lr = new FeatureLayerReader(layer); | 129 FeatureLayerReader lr = new FeatureLayerReader(layer); |
130 lr.setUtil(util); | 130 lr.setUtil(util); |
131 Element layerElement = lr.read(); | 131 Element layerElement = lr.read(); |
132 if (layerElement == null) { | |
133 continue; | |
134 } | |
132 IFeatureRenderer renderer = | 135 IFeatureRenderer renderer = |
133 ((FeatureLayer)layer).getRenderer(); | 136 ((FeatureLayer)layer).getRenderer(); |
134 IRendererReader rreader; | 137 IRendererReader rreader; |
135 if(renderer instanceof SimpleRenderer) { | 138 if(renderer instanceof SimpleRenderer) { |
136 rreader = new SimpleRendererReader(renderer); | 139 rreader = new SimpleRendererReader(renderer); |
187 } | 190 } |
188 } | 191 } |
189 } | 192 } |
190 catch(Exception e) { | 193 catch(Exception e) { |
191 invalidLayerCount++; | 194 invalidLayerCount++; |
192 if(i == 0 && (i + 1) < map.getLayerCount() || | 195 if(i == 0 && (i + 1) == map.getLayerCount() || |
193 invalidLayerCount == map.getLayerCount()) { | 196 invalidLayerCount == map.getLayerCount()) { |
194 throw new IOException( | 197 throw new IOException( |
195 "No valid layer in MXD file." + | 198 "No valid layer in MXD file." + |
196 " Aborting."); | 199 " Aborting."); |
197 } | 200 } |