Revision 818 org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.algorithm/org.gvsig.geoprocess.algorithm.base/src/main/java/org/gvsig/geoprocess/algorithm/base/core/ScalableUnionOperation.java
ScalableUnionOperation.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import com.vividsolutions.jts.geom.Geometry; |
31 | 31 |
|
32 |
import org.slf4j.Logger; |
|
33 |
import org.slf4j.LoggerFactory; |
|
34 |
|
|
35 | 32 |
import es.unex.sextante.core.Sextante; |
36 | 33 |
import es.unex.sextante.dataObjects.IVectorLayer; |
37 | 34 |
import es.unex.sextante.exceptions.NullParameterValueException; |
38 | 35 |
import es.unex.sextante.exceptions.WrongParameterIDException; |
39 | 36 |
import es.unex.sextante.exceptions.WrongParameterTypeException; |
40 | 37 |
|
38 |
import org.slf4j.Logger; |
|
39 |
import org.slf4j.LoggerFactory; |
|
40 |
|
|
41 | 41 |
import org.gvsig.fmap.dal.exception.DataException; |
42 | 42 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
43 | 43 |
import org.gvsig.fmap.dal.feature.Feature; |
... | ... | |
49 | 49 |
import org.gvsig.geoprocess.algorithm.base.visitor.exception.VisitorException; |
50 | 50 |
import org.gvsig.geoprocess.lib.sextante.AbstractSextanteGeoProcess; |
51 | 51 |
import org.gvsig.geoprocess.lib.sextante.dataObjects.FlyrVectIVectorLayer; |
52 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
53 | 52 |
|
54 | 53 |
/** |
55 | 54 |
* Joins all geometries in a layer |
... | ... | |
142 | 141 |
return; |
143 | 142 |
} |
144 | 143 |
|
145 |
if (g.getGeometryType().getType() != TYPES.SURFACE) {
|
|
144 |
if (!g.getGeometryType().isTypeOf(TYPES.SURFACE) && !g.getGeometryType().isTypeOf(TYPES.MULTISURFACE)) {
|
|
146 | 145 |
return; |
147 | 146 |
} |
148 | 147 |
|
... | ... | |
172 | 171 |
private void union(org.gvsig.fmap.geom.Geometry[] geoms) { |
173 | 172 |
Date time1 = new Date(); |
174 | 173 |
if (geoms == null) { |
174 |
|
|
175 | 175 |
return; |
176 | 176 |
} |
177 | 177 |
|
... | ... | |
181 | 181 |
geometries.add(geometry); |
182 | 182 |
} |
183 | 183 |
for (int i = 0; i < geoms.length; i++) { |
184 |
if (geoms[i].getGeometryType().getType() == TYPES.SURFACE) { |
|
185 |
geometries.add(GeometryUtil.geomToJTS(geoms[i])); |
|
184 |
org.gvsig.fmap.geom.Geometry geom = geoms[i]; |
|
185 |
if (geom.getGeometryType().isTypeOf(TYPES.SURFACE) || geom.getGeometryType().isTypeOf(TYPES.MULTISURFACE)) { |
|
186 |
geometries.add(GeometryUtil.geomToJTS(geom)); |
|
186 | 187 |
} |
187 |
} |
|
188 |
} |
|
189 |
|
|
188 | 190 |
geometry = JTSFacade.union((Geometry[]) geometries.toArray(new Geometry[0]), TYPES.SURFACE); |
189 | 191 |
|
190 | 192 |
Date time2 = new Date(); |
Also available in: Unified diff