Mercurial > dive4elements > river
changeset 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 | 4b7944c37c4f |
children | d4b9fe13c9b8 |
files | artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java |
diffstat | 2 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java Thu Aug 15 13:30:16 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java Thu Aug 15 13:35:18 2013 +0200 @@ -120,9 +120,11 @@ setInitialExtent(extent); createWSPLGENLayer(flys, wms, attr); } - else if (FLOODMAP_USERSHAPE.equals(name)) { - createUserShapeLayer(flys, wms); - } + // FIXME: Already generated by HWSBarrierState + // wms has a wrong SRID which would break that layer + //else if (FLOODMAP_USERSHAPE.equals(name)) { + // createUserShapeLayer(flys, wms); + //} else { logger.debug("doOut: createDatabaseLayer for facet name: " + name); createDatabaseLayer(flys, wms, attr);
--- a/artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java Thu Aug 15 13:30:16 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java Thu Aug 15 13:35:18 2013 +0200 @@ -135,11 +135,11 @@ ShapefileReader sfr = new ShapefileReader(sf, true, false, null); ShapefileHeader sfh = sfr.getHeader(); - String group = uuid + MS_USERSHAPE_PREFIX; + String group = MS_USERSHAPE_PREFIX + uuid; String groupTitle = "I18N_USER_SHAPE_TITLE"; LayerInfo info = new LayerInfo(); - info.setName(MS_USERSHAPE_PREFIX + uuid); + info.setName(MS_LAYER_PREFIX + FloodMapState.WSPLGEN_USER_RGD + uuid); if (sfh.getShapeType().isLineType()) { info.setType("LINE"); } @@ -156,7 +156,11 @@ info.setGroupTitle(groupTitle); info.setSrid(wms.getSrid()); - String nameUser = MS_LAYER_PREFIX + wms.getName(); + //String nameUser = MS_LAYER_PREFIX + wms.getName(); + // TODO: This rewrites the user-rgd mapfile fragment generated by + // HWSBarrierState. Otherwise we would have to fragments with same + // layer name. Should be refactored... + String nameUser = MS_LAYER_PREFIX + "user-rgd"; Template tpl = getTemplateByName(SHP_LAYER_TEMPLATE); if (tpl == null) {