Revision 288 org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.algorithm/org.gvsig.geoprocess.algorithm.fusespatially/src/main/java/org/gvsig/geoprocess/algorithm/fusespatially/FuseSpatiallyOperation.java
FuseSpatiallyOperation.java | ||
---|---|---|
59 | 59 |
import org.gvsig.geoprocess.algorithm.base.core.DALFeaturePersister; |
60 | 60 |
import org.gvsig.geoprocess.algorithm.base.core.GeometryOperation; |
61 | 61 |
import org.gvsig.geoprocess.algorithm.base.util.GeometryUtil; |
62 |
import org.gvsig.geoprocess.lib.sextante.AbstractSextanteGeoProcess; |
|
63 | 62 |
|
64 | 63 |
import com.vividsolutions.jts.geom.Geometry; |
65 | 64 |
/** |
... | ... | |
72 | 71 |
private List<Feature> featList = null; |
73 | 72 |
private FeatureStore outFeatureStoreTable = null; |
74 | 73 |
private String idField = "FID"; |
75 |
private AbstractSextanteGeoProcess geoprocess = null; |
|
76 |
private int procesSize = 0; |
|
77 | 74 |
|
78 | 75 |
public FuseSpatiallyOperation(List<Feature> f, FeatureStore outFeatStoreTable, String[] fieldNames, String idField) throws DataException { |
79 | 76 |
this.featList = f; |
... | ... | |
86 | 83 |
this.outFeatureStoreTable = outFeatStoreTable; |
87 | 84 |
} |
88 | 85 |
|
89 |
public void setGeoProcess(AbstractSextanteGeoProcess geoprocess, int size) { |
|
90 |
this.geoprocess = geoprocess; |
|
91 |
this.procesSize = size; |
|
92 |
} |
|
93 |
|
|
94 | 86 |
/* |
95 | 87 |
* (non-Javadoc) |
96 | 88 |
* @see org.gvsig.geoprocess.algorithm.base.core.GeometryOperation#invoke(org.gvsig.fmap.geom.Geometry, org.gvsig.fmap.dal.feature.Feature) |
... | ... | |
101 | 93 |
insertInTable(feature); |
102 | 94 |
|
103 | 95 |
int cont = featList.size() - 1; |
104 |
while(cont >= 0 && !geoprocess.getTaskMonitor().isCanceled()) {
|
|
96 |
while(cont >= 0 && !process.getTaskMonitor().isCanceled()) { |
|
105 | 97 |
Feature f = featList.get(cont); |
106 | 98 |
g = f.getDefaultGeometry(); |
107 | 99 |
Geometry jtsGeom = GeometryUtil.geomToJTS(g); //Multigeometry support |
108 | 100 |
if(jtsGeom.intersects(jtsInputGeom)) { |
109 | 101 |
jtsInputGeom = jtsInputGeom.union(jtsGeom); |
110 | 102 |
featList.remove(cont); |
111 |
geoprocess.setProgress(procesSize - featList.size(), procesSize);
|
|
103 |
process.setProgress(procesSize - featList.size(), procesSize); |
|
112 | 104 |
cont = featList.size(); |
113 | 105 |
insertInTable(f); |
114 | 106 |
} |
Also available in: Unified diff