Revision 5628 trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/spatialjoin/fmap/SpatiallyIndexedSpatialJoinVisitor.java

View differences:

SpatiallyIndexedSpatialJoinVisitor.java
45 45
*
46 46
* $Id$
47 47
* $Log$
48
* Revision 1.1  2006-05-24 21:09:47  azabala
48
* Revision 1.2  2006-06-02 18:21:28  azabala
49
* *** empty log message ***
50
*
51
* Revision 1.1  2006/05/24 21:09:47  azabala
49 52
* primera version en cvs despues de refactoring orientado a crear un framework extensible de geoprocessing
50 53
*
51 54
* Revision 1.1  2006/05/02 18:58:47  azabala
......
109 112
			FLyrVect targetLayer, 
110 113
			FeatureProcessor processor) throws DriverException {
111 114
		super(sourceLayer, targetLayer, processor);
112
		initialize();
115
//		lo comentamos porque debe ser llamado externamente
116
//		initialize();
113 117
	}
114 118
	
115
	void initialize(){
119
	public void initialize(){
116 120
		ISpatialIndex spatialIndex =
117 121
			targetLayer.getISpatialIndex();
118 122
		if(spatialIndex instanceof INearestNeighbourFinder)
119 123
			nearestFinder = (INearestNeighbourFinder)spatialIndex;
120 124
		else
121
			throw new IllegalArgumentException("La segunda capa de spatial join ha de tener un ?ndice espacial de tipo RTreeSptLib para usar este visitor");
125
			throw new IllegalArgumentException("La segunda capa de spatial join ha de tener un ?ndice espacial de tipo INearestNeighbourFinder para usar este visitor");
122 126
	}
123 127
	
124 128
	
......
128 132
	 * target layer and taking attributes from it
129 133
	 */
130 134
	public void visit(IGeometry g, int sourceIndex) throws VisitException {
135
		if(g == null)
136
			return;
131 137
		try {
138
long t0 = System.currentTimeMillis();			
132 139
		//no se si el rtree har? la busqueda bien si el rectangulo
133 140
		//de busqueda no est? insertado. Hacer las pruebas (si no,
134 141
		//a?adimos ahora y borramos luego)
......
158 165
		
159 166
			joinedFeature = createFeature(g, sourceIndex, targetIndex);
160 167
			this.featureProcessor.processFeature(joinedFeature);
168
long t1 = System.currentTimeMillis();
169
System.out.println((t1-t0)+" en spatial join con indice espacial");
161 170
		} catch (DriverException e) {
162 171
			throw new VisitException("Error de driver al escribir un feature resultante de un spatial join", e);
163 172
		} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {

Also available in: Unified diff