Revision 29576
trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/impl/difference/fmap/DifferenceGeoprocess.java | ||
---|---|---|
108 | 108 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
109 | 109 |
import com.hardcode.gdbms.driver.exceptions.SchemaEditionException; |
110 | 110 |
import com.iver.andami.PluginServices; |
111 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
|
112 | 111 |
import com.iver.cit.gvsig.exceptions.visitors.ProcessVisitorException; |
113 | 112 |
import com.iver.cit.gvsig.exceptions.visitors.VisitorException; |
114 | 113 |
import com.iver.cit.gvsig.fmap.core.FShape; |
115 | 114 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
116 | 115 |
import com.iver.cit.gvsig.fmap.drivers.ILayerDefinition; |
116 |
import com.iver.cit.gvsig.fmap.edition.writers.shp.MultiShpWriter; |
|
117 | 117 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
118 | 118 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
119 | 119 |
import com.iver.cit.gvsig.fmap.operations.strategies.Strategy; |
... | ... | |
342 | 342 |
|
343 | 343 |
public void run() throws GeoprocessException { |
344 | 344 |
try { |
345 |
schemaManager.createSchema(createLayerDefinition()); |
|
345 |
if (!(writer instanceof MultiShpWriter)){ |
|
346 |
schemaManager.createSchema(createLayerDefinition()); |
|
347 |
} |
|
346 | 348 |
writer.preProcess(); |
347 | 349 |
Strategy strategy = |
348 | 350 |
StrategyManager.getStrategy(firstLayer); |
... | ... | |
393 | 395 |
*/ |
394 | 396 |
public void finished() { |
395 | 397 |
// TODO Auto-generated method stub |
396 |
|
|
398 |
|
|
397 | 399 |
} |
398 | 400 |
} |
399 | 401 |
|
trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/impl/difference/DifferenceGeoprocessController.java | ||
---|---|---|
96 | 96 |
import com.iver.cit.gvsig.fmap.drivers.SHPLayerDefinition; |
97 | 97 |
import com.iver.cit.gvsig.fmap.edition.IWriter; |
98 | 98 |
import com.iver.cit.gvsig.fmap.edition.ShpSchemaManager; |
99 |
import com.iver.cit.gvsig.fmap.edition.writers.shp.MultiShpWriter; |
|
99 | 100 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
100 | 101 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
101 | 102 |
import com.iver.cit.gvsig.geoprocess.core.fmap.AbstractGeoprocessController; |
... | ... | |
142 | 143 |
geoProcessingDifferencePanel.error(errorDescription, error); |
143 | 144 |
return false; |
144 | 145 |
} |
145 |
if (outputFile.exists()) { |
|
146 |
if (!geoProcessingDifferencePanel.askForOverwriteOutputFile(outputFile)) { |
|
147 |
return false; |
|
148 |
} |
|
149 |
} |
|
146 |
|
|
150 | 147 |
DifferenceGeoprocess diff = new DifferenceGeoprocess(inputLayer); |
151 | 148 |
diff.setSecondOperand(overlayLayer); |
152 | 149 |
SHPLayerDefinition definition = (SHPLayerDefinition) diff |
... | ... | |
162 | 159 |
geoProcessingDifferencePanel.error(errorDescription, error); |
163 | 160 |
return false; |
164 | 161 |
} |
162 |
|
|
163 |
|
|
164 |
boolean found = false; |
|
165 |
if (writer instanceof MultiShpWriter){ |
|
166 |
MultiShpWriter mWriter = (MultiShpWriter) writer; |
|
167 |
|
|
168 |
if (mWriter.getPointsFile().exists()){ |
|
169 |
found = true; |
|
170 |
} |
|
171 |
if (mWriter.getLinesFile().exists()){ |
|
172 |
found = true; |
|
173 |
} |
|
174 |
if (mWriter.getPolygonsFile().exists()){ |
|
175 |
found = true; |
|
176 |
} |
|
177 |
|
|
178 |
} else{ |
|
179 |
found = outputFile.exists(); |
|
180 |
} |
|
181 |
if (found){ |
|
182 |
if (!geoProcessingDifferencePanel.askForOverwriteOutputFile(outputFile)) { |
|
183 |
return false; |
|
184 |
} |
|
185 |
} |
|
186 |
|
|
165 | 187 |
diff.setResultLayerProperties(writer, schemaManager); |
166 | 188 |
HashMap params = new HashMap(); |
167 | 189 |
boolean onlySelectedFirst = geoProcessingDifferencePanel |
Also available in: Unified diff