Revision 251 org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.algorithm/org.gvsig.geoprocess.algorithm.convexhull/src/main/java/org/gvsig/geoprocess/algorithm/convexhull/ConvexHullAlgorithm.java
ConvexHullAlgorithm.java | ||
---|---|---|
26 | 26 |
import java.util.Iterator; |
27 | 27 |
import java.util.List; |
28 | 28 |
|
29 |
import es.unex.sextante.core.Sextante; |
|
30 |
import es.unex.sextante.dataObjects.IVectorLayer; |
|
31 |
import es.unex.sextante.exceptions.GeoAlgorithmExecutionException; |
|
32 |
import es.unex.sextante.exceptions.RepeatedParameterNameException; |
|
33 |
import es.unex.sextante.outputs.OutputVectorLayer; |
|
34 |
|
|
29 |
import org.gvsig.fmap.dal.DALLocator; |
|
30 |
import org.gvsig.fmap.dal.DataManager; |
|
35 | 31 |
import org.gvsig.fmap.dal.exception.DataException; |
36 | 32 |
import org.gvsig.fmap.dal.feature.Feature; |
33 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
37 | 34 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
38 | 35 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
39 | 36 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
40 | 37 |
import org.gvsig.fmap.geom.Geometry; |
38 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
|
41 | 39 |
import org.gvsig.geoprocess.algorithm.base.util.GeometryUtil; |
42 | 40 |
import org.gvsig.geoprocess.lib.sextante.AbstractSextanteGeoProcess; |
43 | 41 |
import org.gvsig.geoprocess.lib.sextante.dataObjects.FlyrVectIVectorLayer; |
44 | 42 |
import org.gvsig.tools.dispose.DisposableIterator; |
43 |
import org.slf4j.Logger; |
|
44 |
import org.slf4j.LoggerFactory; |
|
45 | 45 |
|
46 |
import es.unex.sextante.core.Sextante; |
|
47 |
import es.unex.sextante.dataObjects.IVectorLayer; |
|
48 |
import es.unex.sextante.exceptions.GeoAlgorithmExecutionException; |
|
49 |
import es.unex.sextante.exceptions.RepeatedParameterNameException; |
|
50 |
import es.unex.sextante.outputs.OutputVectorLayer; |
|
51 |
|
|
46 | 52 |
/** |
47 | 53 |
* Convex Hull Algorithm |
48 | 54 |
* |
49 | 55 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
50 | 56 |
*/ |
51 | 57 |
public class ConvexHullAlgorithm extends AbstractSextanteGeoProcess { |
52 |
|
|
58 |
private static final Logger log = LoggerFactory.getLogger(ConvexHullAlgorithm.class); |
|
53 | 59 |
public static final String LAYER = "LAYER"; |
54 | 60 |
public static final String RESULT = "RESULT"; |
55 | 61 |
public static final String CHECK = "CHECK"; |
... | ... | |
93 | 99 |
|
94 | 100 |
FeatureSet features = null; |
95 | 101 |
try { |
96 |
features = store.getFeatureSet(); |
|
97 |
|
|
98 | 102 |
DisposableIterator it = null; |
99 | 103 |
if (selectedGeom) { |
104 |
features = store.getFeatureSet(); |
|
100 | 105 |
FeatureSelection ds = store.getFeatureSelection(); |
101 | 106 |
it = ds.iterator(); |
102 |
// if(!it.hasNext())Mensaje de no hay geometrias seleccionadas |
|
103 |
} else |
|
107 |
} else { |
|
108 |
FeatureQuery query = getQueryFromAnalysisExtent(m_AnalysisExtent, store); |
|
109 |
features = store.getFeatureSet(query); |
|
104 | 110 |
it = features.iterator(); |
111 |
} |
|
105 | 112 |
|
106 | 113 |
int numberOfFeatures = (int) features.getSize(); |
107 | 114 |
int iCount = 0; |
... | ... | |
138 | 145 |
output.addFeature(jtsGeom, new Object[] { new Integer(0) }); |
139 | 146 |
it.dispose(); |
140 | 147 |
} catch (DataException e) { |
141 |
Sextante.addErrorToLog(e); |
|
142 |
} |
|
148 |
log.error("", e); |
|
149 |
} catch (CreateEnvelopeException e) { |
|
150 |
log.error("Error creating envelope", e); |
|
151 |
} |
|
143 | 152 |
return !m_Task.isCanceled(); |
144 | 153 |
} |
145 | 154 |
} |
Also available in: Unified diff