Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/MapGenerator.java @ 5076:cc50e1b9fc60 mapgenfix
Work on ArtifactMapfileGenerator.createUserShapefileLayer()
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 20 Feb 2013 21:00:33 +0100 |
parents | a9243df307b1 |
children | cfc5540a4eec |
comparison
equal
deleted
inserted
replaced
5023:1da61095040c | 5076:cc50e1b9fc60 |
---|---|
10 import de.intevation.artifacts.common.ArtifactNamespaceContext; | 10 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
11 import de.intevation.artifacts.common.utils.XMLUtils; | 11 import de.intevation.artifacts.common.utils.XMLUtils; |
12 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; | 12 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
13 import de.intevation.flys.artifacts.FLYSArtifact; | 13 import de.intevation.flys.artifacts.FLYSArtifact; |
14 import de.intevation.flys.artifacts.model.FacetTypes; | 14 import de.intevation.flys.artifacts.model.FacetTypes; |
15 import de.intevation.flys.artifacts.model.map.WMSDBLayerFacet; | |
16 import de.intevation.flys.artifacts.model.map.WMSLayerFacet; | 15 import de.intevation.flys.artifacts.model.map.WMSLayerFacet; |
17 import de.intevation.flys.artifacts.model.map.WSPLGENLayerFacet; | 16 import de.intevation.flys.artifacts.model.map.WSPLGENLayerFacet; |
18 import de.intevation.flys.collections.FLYSArtifactCollection; | 17 import de.intevation.flys.collections.FLYSArtifactCollection; |
19 import de.intevation.flys.mapserver.ArtifactMapfileGenerator; | 18 import de.intevation.flys.mapserver.ArtifactMapfileGenerator; |
20 import de.intevation.flys.utils.GeometryUtils; | 19 import de.intevation.flys.utils.GeometryUtils; |
21 import de.intevation.flys.utils.ThemeUtil; | |
22 | 20 |
23 import java.io.File; | 21 import java.io.File; |
24 import java.io.FileNotFoundException; | 22 import java.io.FileNotFoundException; |
25 import java.io.IOException; | 23 import java.io.IOException; |
26 import java.io.OutputStream; | 24 import java.io.OutputStream; |
121 protected void createWSPLGENLayer( | 119 protected void createWSPLGENLayer( |
122 FLYSArtifact flys, | 120 FLYSArtifact flys, |
123 WMSLayerFacet wms, | 121 WMSLayerFacet wms, |
124 Document attr | 122 Document attr |
125 ) { | 123 ) { |
126 try { | 124 //try { |
127 if(wms instanceof WSPLGENLayerFacet) { | 125 if(wms instanceof WSPLGENLayerFacet) { |
128 ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); | 126 ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); |
129 mfg.createUeskLayer( | 127 /*mfg.createUeskLayer( |
130 flys, | 128 flys, |
131 (WSPLGENLayerFacet) wms, | 129 (WSPLGENLayerFacet) wms, |
132 ThemeUtil.createDynamicMapserverStyle(attr), | 130 ThemeUtil.createDynamicMapserverStyle(attr), |
133 context); | 131 context);*/ // FIXME |
134 } | 132 } |
135 else { | 133 else { |
136 logger.warn("Cannot create WSPLGEN layer from: " + | 134 logger.warn("Cannot create WSPLGEN layer from: " + |
137 wms.getClass()); | 135 wms.getClass()); |
138 } | 136 } |
137 //} | |
138 /*catch (IOException ioe) { | |
139 logger.error(ioe, ioe); | |
140 }*/ | |
141 } | |
142 | |
143 | |
144 protected void createBarriersLayer(FLYSArtifact flys, WMSLayerFacet wms) { | |
145 ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); | |
146 /* | |
147 try { | |
148 mfg.createBarriersLayer(flys, wms); | |
149 } | |
150 catch (FileNotFoundException fnfe) { | |
151 logger.error(fnfe, fnfe); | |
139 } | 152 } |
140 catch (IOException ioe) { | 153 catch (IOException ioe) { |
141 logger.error(ioe, ioe); | 154 logger.error(ioe, ioe); |
142 } | 155 }*/ // FIXME |
143 } | 156 } |
144 | 157 |
145 | 158 |
146 protected void createBarriersLayer(FLYSArtifact flys, WMSLayerFacet wms) { | 159 protected void createUserShapeLayer(FLYSArtifact flys, WMSLayerFacet wms) { |
147 ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); | 160 ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); |
148 | 161 /* |
149 try { | 162 try { |
150 mfg.createBarriersLayer(flys, wms); | 163 mfg.createUserShapeLayer(flys, wms); |
151 } | 164 } |
152 catch (FileNotFoundException fnfe) { | 165 catch (FileNotFoundException fnfe) { |
153 logger.error(fnfe, fnfe); | 166 logger.error(fnfe, fnfe); |
154 } | 167 } |
155 catch (IOException ioe) { | 168 catch (IOException ioe) { |
156 logger.error(ioe, ioe); | 169 logger.error(ioe, ioe); |
157 } | 170 }*/ // FIXME |
158 } | |
159 | |
160 | |
161 protected void createUserShapeLayer(FLYSArtifact flys, WMSLayerFacet wms) { | |
162 ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); | |
163 | |
164 try { | |
165 mfg.createUserShapeLayer(flys, wms); | |
166 } | |
167 catch (FileNotFoundException fnfe) { | |
168 logger.error(fnfe, fnfe); | |
169 } | |
170 catch (IOException ioe) { | |
171 logger.error(ioe, ioe); | |
172 } | |
173 } | 171 } |
174 | 172 |
175 | 173 |
176 protected void createDatabaseLayer( | 174 protected void createDatabaseLayer( |
177 FLYSArtifact flys, | 175 FLYSArtifact flys, |
189 if (artDir != null && !artDir.exists()) { | 187 if (artDir != null && !artDir.exists()) { |
190 logger.debug("Create new directory: " + artDir.getPath()); | 188 logger.debug("Create new directory: " + artDir.getPath()); |
191 artDir.mkdir(); | 189 artDir.mkdir(); |
192 } | 190 } |
193 | 191 |
194 if (wms instanceof WMSDBLayerFacet) { | 192 /*if (wms instanceof WMSDBLayerFacet) { |
195 mfg.createDatabaseLayer( | 193 mfg.createDatabaseLayer( |
196 flys, | 194 flys, |
197 (WMSDBLayerFacet) wms, | 195 (WMSDBLayerFacet) wms, |
198 ThemeUtil.createMapserverStyle(attr)); | 196 ThemeUtil.createMapserverStyle(attr)); |
199 } | 197 } |
200 else { | 198 else { |
201 logger.warn("Cannot create DB layer from: " + wms.getClass()); | 199 logger.warn("Cannot create DB layer from: " + wms.getClass()); |
202 } | 200 }*/ // FIXME |
203 } | 201 } |
204 catch (FileNotFoundException fnfe) { | 202 catch (FileNotFoundException fnfe) { |
205 logger.error(fnfe, fnfe); | 203 logger.error(fnfe, fnfe); |
206 } | 204 } |
207 catch (IOException ioe) { | 205 catch (IOException ioe) { |