Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/MapGenerator.java @ 1775:0156105222c9
Improved the MapfileGenerator. It offers methods to create barrier and wsplgen layer files for mapserver.
flys-artifacts/trunk@3097 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 28 Oct 2011 08:36:32 +0000 |
parents | 092e1e5020bc |
children | 7d1bd710a4b3 |
comparison
equal
deleted
inserted
replaced
1774:092e1e5020bc | 1775:0156105222c9 |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import java.io.FileNotFoundException; | |
3 import java.io.IOException; | 4 import java.io.IOException; |
4 import java.io.OutputStream; | 5 import java.io.OutputStream; |
5 import java.util.ArrayList; | 6 import java.util.ArrayList; |
6 import java.util.List; | 7 import java.util.List; |
7 | 8 |
23 | 24 |
24 import de.intevation.flys.artifacts.FLYSArtifact; | 25 import de.intevation.flys.artifacts.FLYSArtifact; |
25 import de.intevation.flys.artifacts.model.FacetTypes; | 26 import de.intevation.flys.artifacts.model.FacetTypes; |
26 import de.intevation.flys.artifacts.model.WMSLayerFacet; | 27 import de.intevation.flys.artifacts.model.WMSLayerFacet; |
27 import de.intevation.flys.utils.GeometryUtils; | 28 import de.intevation.flys.utils.GeometryUtils; |
29 import de.intevation.flys.utils.MapfileGenerator; | |
28 | 30 |
29 | 31 |
30 public class MapGenerator implements OutGenerator, FacetTypes { | 32 public class MapGenerator implements OutGenerator, FacetTypes { |
31 | 33 |
32 private static Logger logger = Logger.getLogger(MapGenerator.class); | 34 private static Logger logger = Logger.getLogger(MapGenerator.class); |
92 layers.add(wms); | 94 layers.add(wms); |
93 | 95 |
94 setMaxExtent(extent); | 96 setMaxExtent(extent); |
95 setSrid(wms.getSrid()); | 97 setSrid(wms.getSrid()); |
96 | 98 |
97 if (FLOODMAP_WSPLGEN.equals(name) && initialExtent == null) { | 99 if (FLOODMAP_WSPLGEN.equals(name)) { |
98 setInitialExtent(extent); | 100 if (initialExtent == null) { |
101 setInitialExtent(extent); | |
102 } | |
103 | |
104 createWSPLGENLayer(flys, wms); | |
105 } | |
106 else if (FLOODMAP_BARRIERS.equals(name)) { | |
107 createBarriersLayer(flys, wms); | |
99 } | 108 } |
100 } | 109 } |
101 else { | 110 else { |
102 logger.warn("Facet not supported: " + nativeFacet.getClass()); | 111 logger.warn("Facet not supported: " + nativeFacet.getClass()); |
103 } | 112 } |
104 | 113 } |
114 | |
115 | |
116 protected void createWSPLGENLayer(FLYSArtifact flys, WMSLayerFacet wms) { | |
117 MapfileGenerator mfg = MapfileGenerator.getInstance(); | |
118 mfg.createUeskLayer(flys, wms); | |
119 } | |
120 | |
121 | |
122 protected void createBarriersLayer(FLYSArtifact flys, WMSLayerFacet wms) { | |
123 MapfileGenerator mfg = MapfileGenerator.getInstance(); | |
124 | |
125 try { | |
126 mfg.createBarriersLayer(flys, wms); | |
127 } | |
128 catch (FileNotFoundException fnfe) { | |
129 logger.error(fnfe, fnfe); | |
130 } | |
131 catch (IOException ioe) { | |
132 logger.error(ioe, ioe); | |
133 } | |
105 } | 134 } |
106 | 135 |
107 | 136 |
108 @Override | 137 @Override |
109 public void generate() | 138 public void generate() |