Revision 5011

View differences:

trunk/extensions/extGeoProcessing/src/com/iver/gvsig/geoprocessing/impl/spatialjoin/SpatialJoinGeoprocess.java
45 45
 *
46 46
 * $Id$
47 47
 * $Log$
48
 * Revision 1.8  2006-05-01 19:09:23  azabala
48
 * Revision 1.9  2006-05-02 18:57:33  azabala
49
 * added a new implementation of nearest neighbour finder, based in RTree spatial index
50
 *
51
 * Revision 1.8  2006/05/01 19:09:23  azabala
49 52
 * Intento de optimizar el spatial join por vecino mas proximo (no funciona)
50 53
 *
51 54
 * Revision 1.7  2006/03/21 19:29:36  azabala
......
87 90
import com.iver.cit.gvsig.fmap.operations.strategies.Strategy;
88 91
import com.iver.cit.gvsig.fmap.operations.strategies.StrategyManager;
89 92
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
93
import com.iver.cit.gvsig.fmap.spatialindex.INearestNeighbourFinder;
94
import com.iver.cit.gvsig.fmap.spatialindex.ISpatialIndex;
90 95
import com.iver.gvsig.geoprocessing.impl.AbstractGeoprocess;
91 96
import com.iver.gvsig.geoprocessing.impl.jtsprocessors.FeaturePersisterProcessor2;
92 97
import com.iver.gvsig.geoprocessing.model.GeoprocessException;
......
193 198
			this.nearestSpatialJoin = nearest.booleanValue();
194 199
		if(nearestSpatialJoin){
195 200
			try {
196
//				visitor = new NearestSpatialJoinVisitor(this.firstLayer, 
197
//										this.secondLayer,
198
//										processor);
199
				visitor = new NearestHeuristicSpatialJoinVisitor(firstLayer, 
200
						secondLayer, 
201
						processor);
201
				ISpatialIndex spatialIndex = secondLayer.getISpatialIndex();
202
				if(spatialIndex != null && 
203
						(spatialIndex instanceof INearestNeighbourFinder))
204
				{
205
					visitor = new SpatiallyIndexedSpatialJoinVisitor(this.firstLayer, 
206
							this.secondLayer,
207
							processor);
208
				}else{
209
					
210
					visitor = new NearestSpatialJoinVisitor(this.firstLayer, 
211
							this.secondLayer,
212
							processor);
213
				}
202 214
			} catch (DriverException e) {
203 215
				throw new GeoprocessException("Error preparando el procesado de las capas a enlazar");
204 216
			}

Also available in: Unified diff