Revision 63 org.gvsig.sextante/trunk/org.gvsig.sextante.app/org.gvsig.sextante.app.algorithm/org.gvsig.sextante.app.algorithm.spatialjoin/src/main/java/org/gvsig/sextante/app/algorithm/spatialjoin/SpatialJoinAlgorithm.java
SpatialJoinAlgorithm.java | ||
---|---|---|
27 | 27 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
28 | 28 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureType; |
30 |
import org.gvsig.sextante.app.algorithm.spatialjoin.SpatiallyIndexedSpatialJoinOperation; |
|
30 | 31 |
import org.gvsig.sextante.app.extension.core.gvGeoAlgorithm; |
31 | 32 |
import org.gvsig.sextante.app.extension.core.gvVectorLayer; |
32 | 33 |
|
... | ... | |
104 | 105 |
|
105 | 106 |
//Builds a new JSIRTree index. To do that we have to replace the default index and |
106 | 107 |
//when the operation has finished then it restores the original default index |
107 |
String indexName = lyr2.getFieldName(0); |
|
108 |
String indexName = "GEOMETRY"; |
|
109 |
|
|
108 | 110 |
try { |
111 |
indexName = lyr2.getFeatureStore().getDefaultFeatureType().getDefaultGeometryAttributeName(); |
|
109 | 112 |
FeatureAttributeDescriptor fat = lyr2.getFeatureStore().getDefaultFeatureType().getAttributeDescriptor(indexName); |
110 | 113 |
String defaultIndex = dataManager.getDefaultFeatureIndexProviderName(fat.getDataType()); |
111 | 114 |
dataManager.setDefaultFeatureIndexProviderName(fat.getDataType(), "JSIRTree"); |
... | ... | |
132 | 135 |
"DIST", |
133 | 136 |
Double.class); |
134 | 137 |
|
135 |
SpatiallyIndexedSpatialJoinOperation operation = new SpatiallyIndexedSpatialJoinOperation(lyr2, indexName); |
|
138 |
SpatiallyIndexedSpatialJoinOperation operation = new SpatiallyIndexedSpatialJoinOperation(lyr2, indexName + "_idx");
|
|
136 | 139 |
operation.setProgressModel(this); |
137 | 140 |
operation.computesGeometryOperation(lyr1.getFeatureStore(), |
138 | 141 |
outFeatStore, |
139 |
Summary,
|
|
142 |
attrNames,
|
|
140 | 143 |
selectedGeom, |
141 | 144 |
true); |
142 | 145 |
} |
Also available in: Unified diff