checkLineDirectionPath.txt

Lluís Marqués, 06/24/2016 10:43 AM

Download (2.58 KB)

 
1
### Eclipse Workspace Patch 1.0
2
#P org.gvsig.toolbox.algorithm
3
Index: src/main/java/es/unex/sextante/topology/checkLineDirectionCoherence/CheckLineDirectionCoherenceAlgorithm.java
4
===================================================================
5
--- src/main/java/es/unex/sextante/topology/checkLineDirectionCoherence/CheckLineDirectionCoherenceAlgorithm.java	(revision 190)
6
+++ src/main/java/es/unex/sextante/topology/checkLineDirectionCoherence/CheckLineDirectionCoherenceAlgorithm.java	(working copy)
7
@@ -8,6 +8,9 @@
8
 import java.util.Iterator;
9
 import java.util.Set;
10
 
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
13
+
14
 import com.vividsolutions.jts.geom.Coordinate;
15
 import com.vividsolutions.jts.geom.Geometry;
16
 import com.vividsolutions.jts.geom.GeometryFactory;
17
@@ -21,13 +24,18 @@
18
 import es.unex.sextante.dataObjects.IVectorLayer;
19
 import es.unex.sextante.dataObjects.vectorFilters.BoundingBoxFilter;
20
 import es.unex.sextante.exceptions.GeoAlgorithmExecutionException;
21
+import es.unex.sextante.exceptions.OptionalParentParameterException;
22
 import es.unex.sextante.exceptions.RepeatedParameterNameException;
23
+import es.unex.sextante.exceptions.UndefinedParentParameterNameException;
24
 import es.unex.sextante.outputs.OutputVectorLayer;
25
 
26
 
27
 public class CheckLineDirectionCoherenceAlgorithm
28
          extends
29
             GeoAlgorithm {
30
+    
31
+    private static final Logger LOG =
32
+        LoggerFactory.getLogger(CheckLineDirectionCoherenceAlgorithm.class);
33
 
34
    public static final String  RESULT    = "RESULT";
35
    public static final String  LINES     = "LINES";
36
@@ -49,14 +57,20 @@
37
 
38
       try {
39
          m_Parameters.addInputVectorLayer(LINES, Sextante.getText("Lines_layer"), AdditionalInfoVectorLayer.SHAPE_TYPE_LINE, true);
40
+         m_Parameters.addTableField(FIELD, Sextante.getText("Field"), LINES);
41
          m_Parameters.addNumericalValue(TOLERANCE, Sextante.getText("Tolerance"),
42
                   AdditionalInfoNumericalValue.NUMERICAL_VALUE_DOUBLE, 1, 0, Double.MAX_VALUE);
43
          addOutputVectorLayer(RESULT, Sextante.getText("Result"), OutputVectorLayer.SHAPE_TYPE_LINE);
44
-      }
45
-      catch (final RepeatedParameterNameException e) {
46
-
47
+      } catch (final RepeatedParameterNameException e) {
48
+          LOG.error("Repeated parameter name", e);
49
+          return;
50
+      } catch (UndefinedParentParameterNameException e) {
51
+          LOG.error("Undefined parameter name", e);
52
+          return;
53
+      } catch (OptionalParentParameterException e) {
54
+          LOG.error("Optional parent parameter", e);
55
+          return;
56
       }
57
-
58
    }
59
 
60