Revision 10626 trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/impl/spatialjoin/fmap/SpatiallyIndexedSpatialJoinVisitor.java
SpatiallyIndexedSpatialJoinVisitor.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.1 2006-06-20 18:20:45 azabala |
|
48 |
* Revision 1.2 2007-03-06 16:47:58 caballero |
|
49 |
* Exceptions |
|
50 |
* |
|
51 |
* Revision 1.1 2006/06/20 18:20:45 azabala |
|
49 | 52 |
* first version in cvs |
50 | 53 |
* |
51 | 54 |
* Revision 1.2 2006/06/02 18:21:28 azabala |
... | ... | |
64 | 67 |
import java.awt.geom.Rectangle2D; |
65 | 68 |
import java.util.List; |
66 | 69 |
|
67 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
70 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
71 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
72 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
|
73 |
import com.iver.cit.gvsig.exceptions.visitors.ProcessVisitorException; |
|
74 |
import com.iver.cit.gvsig.exceptions.visitors.VisitorException; |
|
68 | 75 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
69 | 76 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
70 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
|
71 | 77 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
72 | 78 |
import com.iver.cit.gvsig.fmap.layers.ReadableVectorial; |
73 |
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException; |
|
74 | 79 |
import com.iver.cit.gvsig.fmap.spatialindex.INearestNeighbourFinder; |
75 | 80 |
import com.iver.cit.gvsig.fmap.spatialindex.ISpatialIndex; |
76 | 81 |
import com.iver.cit.gvsig.geoprocess.core.fmap.FeatureProcessor; |
... | ... | |
81 | 86 |
* spatial index with nearest neighbour searching capabilities.<br> |
82 | 87 |
* By now, RTreeSptLib is the only spatial index that is also a |
83 | 88 |
* INearestNeigbourFinder implementation. <br> |
84 |
*
|
|
89 |
* |
|
85 | 90 |
* @author azabala |
86 |
*
|
|
91 |
* |
|
87 | 92 |
*/ |
88 | 93 |
public class SpatiallyIndexedSpatialJoinVisitor extends |
89 | 94 |
NearestSpatialJoinVisitor { |
... | ... | |
107 | 112 |
|
108 | 113 |
/** |
109 | 114 |
* Constructor |
110 |
*
|
|
115 |
* |
|
111 | 116 |
* @param sourceLayer |
112 | 117 |
* @param targetLayer |
113 | 118 |
* @param processor |
... | ... | |
115 | 120 |
*/ |
116 | 121 |
public SpatiallyIndexedSpatialJoinVisitor(FLyrVect sourceLayer, |
117 | 122 |
FLyrVect targetLayer, FeatureProcessor processor) |
118 |
throws DriverException { |
|
123 |
throws ReadDriverException {
|
|
119 | 124 |
super(sourceLayer, targetLayer, processor); |
120 | 125 |
// lo comentamos porque debe ser llamado externamente |
121 | 126 |
// initialize(); |
... | ... | |
134 | 139 |
* Processes a Feature of source layer, looking for its nearest feature of |
135 | 140 |
* target layer and taking attributes from it |
136 | 141 |
*/ |
137 |
public void visit(IGeometry g, int sourceIndex) throws VisitException { |
|
142 |
public void visit(IGeometry g, int sourceIndex) throws VisitorException, ProcessVisitorException {
|
|
138 | 143 |
if (g == null) |
139 | 144 |
return; |
140 | 145 |
try { |
... | ... | |
161 | 166 |
}// if |
162 | 167 |
}// for |
163 | 168 |
if (targetIndex == -1) |
164 |
throw new VisitException(
|
|
169 |
throw new ProcessVisitorException(targetRecordset.getName(),null,
|
|
165 | 170 |
"Problemas durante el spatial join, no se encontr? un vecino mas proximo"); |
166 | 171 |
IFeature joinedFeature = createFeature(g, sourceIndex, targetIndex, |
167 | 172 |
nearestDistance); |
168 | 173 |
this.featureProcessor.processFeature(joinedFeature); |
169 |
} catch (DriverException e) { |
|
170 |
throw new VisitException( |
|
171 |
"Error de driver al escribir un feature resultante de un spatial join", |
|
172 |
e); |
|
173 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
174 |
throw new VisitException( |
|
175 |
"Error de driver al escribir un feature resultante de un spatial join", |
|
176 |
e); |
|
177 |
} catch (DriverIOException e) { |
|
178 |
throw new VisitException( |
|
179 |
"Error accediendo a datos de la capa destino en spatial join", |
|
180 |
e); |
|
174 |
} catch (ReadDriverException e) { |
|
175 |
throw new ProcessVisitorException(targetRecordset.getName(),e, |
|
176 |
"Error de driver al escribir un feature resultante de un spatial join"); |
|
177 |
} catch (ExpansionFileReadException e) { |
|
178 |
throw new ProcessVisitorException(targetRecordset.getName(),e, |
|
179 |
"Error de driver al escribir un feature resultante de un spatial join"); |
|
181 | 180 |
} |
182 | 181 |
|
183 | 182 |
} |
Also available in: Unified diff