comparison artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java @ 6833:20f98087664d

(issue657) Prevent errornous recreation of usershape mapfile fragment. This is a hotfix for now to get at least barriers.zip working again.
author Christian Lins <christian.lins@intevation.de>
date Thu, 15 Aug 2013 13:35:18 +0200
parents 8c7433b8656d
children d4b9fe13c9b8
comparison
equal deleted inserted replaced
6832:4b7944c37c4f 6833:20f98087664d
133 File userShape = new File(dir, WSPLGEN_USER_SHAPE); 133 File userShape = new File(dir, WSPLGEN_USER_SHAPE);
134 ShpFiles sf = new ShpFiles(userShape); 134 ShpFiles sf = new ShpFiles(userShape);
135 ShapefileReader sfr = new ShapefileReader(sf, true, false, null); 135 ShapefileReader sfr = new ShapefileReader(sf, true, false, null);
136 ShapefileHeader sfh = sfr.getHeader(); 136 ShapefileHeader sfh = sfr.getHeader();
137 137
138 String group = uuid + MS_USERSHAPE_PREFIX; 138 String group = MS_USERSHAPE_PREFIX + uuid;
139 String groupTitle = "I18N_USER_SHAPE_TITLE"; 139 String groupTitle = "I18N_USER_SHAPE_TITLE";
140 140
141 LayerInfo info = new LayerInfo(); 141 LayerInfo info = new LayerInfo();
142 info.setName(MS_USERSHAPE_PREFIX + uuid); 142 info.setName(MS_LAYER_PREFIX + FloodMapState.WSPLGEN_USER_RGD + uuid);
143 if (sfh.getShapeType().isLineType()) { 143 if (sfh.getShapeType().isLineType()) {
144 info.setType("LINE"); 144 info.setType("LINE");
145 } 145 }
146 else if (sfh.getShapeType().isPolygonType()) { 146 else if (sfh.getShapeType().isPolygonType()) {
147 info.setType("POLYGON"); 147 info.setType("POLYGON");
154 info.setTitle("I18N_USER_SHAPE"); 154 info.setTitle("I18N_USER_SHAPE");
155 info.setGroup(group); 155 info.setGroup(group);
156 info.setGroupTitle(groupTitle); 156 info.setGroupTitle(groupTitle);
157 info.setSrid(wms.getSrid()); 157 info.setSrid(wms.getSrid());
158 158
159 String nameUser = MS_LAYER_PREFIX + wms.getName(); 159 //String nameUser = MS_LAYER_PREFIX + wms.getName();
160 // TODO: This rewrites the user-rgd mapfile fragment generated by
161 // HWSBarrierState. Otherwise we would have to fragments with same
162 // layer name. Should be refactored...
163 String nameUser = MS_LAYER_PREFIX + "user-rgd";
160 164
161 Template tpl = getTemplateByName(SHP_LAYER_TEMPLATE); 165 Template tpl = getTemplateByName(SHP_LAYER_TEMPLATE);
162 if (tpl == null) { 166 if (tpl == null) {
163 logger.warn("Template '" + SHP_LAYER_TEMPLATE + "' found."); 167 logger.warn("Template '" + SHP_LAYER_TEMPLATE + "' found.");
164 return; 168 return;

http://dive4elements.wald.intevation.org