[PATCH 1 of 2] Avoid writing defect mapfiles for layers without extent

Wald Commits scm-commit at wald.intevation.org
Fri Jun 5 16:59:02 CEST 2015


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1433515987 -7200
# Node ID e701ef544ffa2586cf4384f4594d27c8ec29ce61
# Parent  787dff3fd634e3e969398f8a5552a1a0267a4ae9
Avoid writing defect mapfiles for layers without extent.

diff -r 787dff3fd634 -r e701ef544ffa artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Thu May 21 16:10:21 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Fri Jun 05 16:53:07 2015 +0200
@@ -306,7 +306,7 @@
             mE = GeometryUtils.jtsBoundsToOLBounds(this.maxExtent);
         } else {
             log.error("Layer without extent. Probably no geometry at all.");
-            mE = "0 0 0 0";
+            mE = "0 0 1 1";
         }
 
         Element maxExtent = c.create("maxExtent");
diff -r 787dff3fd634 -r e701ef544ffa artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java	Thu May 21 16:10:21 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java	Fri Jun 05 16:53:07 2015 +0200
@@ -226,6 +226,9 @@
         layerinfo.setStyle(style);
         if(wms.getExtent() != null) {
             layerinfo.setExtent(GeometryUtils.jtsBoundsToOLBounds(wms.getExtent()));
+        } else {
+            log.error("Layer without extent. Probably no geometry at all.");
+            layerinfo.setExtent("0 0 1 1");
         }
         layerinfo.setConnection(wms.getConnection());
         layerinfo.setConnectionType(wms.getConnectionType());


More information about the Dive4Elements-commits mailing list