[PATCH 3 of 3] Cross section importer: avoid logging of unused feature

Wald Commits scm-commit at wald.intevation.org
Wed Jan 22 13:27:55 CET 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1390393595 -3600
# Node ID 46273d890da580d7058771b2cfb84a200a1abe56
# Parent  228be10e6165cb507bd20e3bd71671dad61c8967
Cross section importer: avoid logging of unused feature.

diff -r 228be10e6165 -r 46273d890da5 backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java	Wed Jan 22 12:54:18 2014 +0100
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java	Wed Jan 22 13:26:35 2014 +0100
@@ -252,13 +252,15 @@
 
             ImportRiver.this.addCrossSections(description, ti, lines);
 
-            double percent = numReadPoints > 0L
-                ? ((double)numRemainingPoints/numReadPoints)*100d
-                : 0d;
+            if (simplificationEpsilon != null) {
+                double percent = numReadPoints > 0L
+                    ? ((double)numRemainingPoints/numReadPoints)*100d
+                    : 0d;
 
-            log.info(String.format(
-                "Number of points in cross section: %d / %d (%.2f%%)",
-                numReadPoints, numRemainingPoints, percent));
+                log.info(String.format(
+                    "Number of points in cross section: %d / %d (%.2f%%)",
+                    numReadPoints, numRemainingPoints, percent));
+            }
         }
     } // ImportRiverCrossSectionParserCallback
 


More information about the Dive4elements-commits mailing list