Revision 3564 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/InfoListener.java
InfoListener.java | ||
---|---|---|
68 | 68 |
import com.iver.cit.gvsig.fmap.MapControl; |
69 | 69 |
import com.iver.cit.gvsig.fmap.ViewPort; |
70 | 70 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
71 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
|
71 | 72 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
73 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
72 | 74 |
import com.iver.cit.gvsig.fmap.layers.RasterOperations; |
73 | 75 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData; |
74 | 76 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint; |
... | ... | |
149 | 151 |
for (int i = 0; i < sel.length; i++) { |
150 | 152 |
FLayer laCapa = (FLayer) sel[i]; |
151 | 153 |
|
152 |
if ((laCapa instanceof VectorialData) |
|
153 |
&& (laCapa instanceof AlphanumericData)) { |
|
154 |
QueryByPointVisitor visitor = new QueryByPointVisitor(); |
|
155 |
visitor.setLayer(laCapa); |
|
156 |
visitor.setQueriedPoint(pReal); |
|
157 |
visitor.setTolerance(mapCtrl.getMapContext().getViewPort() |
|
158 |
.toMapDistance(3)); |
|
159 |
try { |
|
160 |
((VectorialData) laCapa).process(visitor); |
|
161 |
} catch (DriverException e) { |
|
162 |
throw new BehaviorException("No se pudo procesar la capa", |
|
163 |
e); |
|
164 |
} catch (VisitException e) { |
|
165 |
throw new RuntimeException(e); |
|
166 |
} |
|
154 |
// Estos cambios son para que si existe un ?ndice espacial |
|
155 |
// se aproveche. Mucho m?s r?pidas las consultas. |
|
156 |
/* if ((laCapa instanceof VectorialData) |
|
157 |
&& (laCapa instanceof AlphanumericData)) { */ |
|
158 |
if (laCapa instanceof FLyrVect) |
|
159 |
{ |
|
160 |
// Tolerancia de 3 pixels |
|
161 |
FLyrVect lyrVect = (FLyrVect) laCapa; |
|
162 |
double tol = mapCtrl.getViewPort().toMapDistance(3); |
|
167 | 163 |
|
164 |
FBitSet newBitSet; |
|
165 |
try { |
|
166 |
newBitSet = lyrVect.queryByPoint(pReal, tol); |
|
167 |
items[i] = new VectorialXMLItem(newBitSet, laCapa); |
|
168 |
numLayersInfoable++; |
|
169 |
} catch (DriverException e) { |
|
170 |
// TODO Auto-generated catch block |
|
171 |
e.printStackTrace(); |
|
172 |
throw new BehaviorException("Fallo al consultar " + lyrVect.getName()); |
|
173 |
} |
|
174 |
|
|
175 |
/* else |
|
176 |
{ |
|
177 |
QueryByPointVisitor visitor = new QueryByPointVisitor(); |
|
178 |
visitor.setLayer(laCapa); |
|
179 |
visitor.setQueriedPoint(pReal); |
|
180 |
visitor.setTolerance(mapCtrl.getMapContext().getViewPort() |
|
181 |
.toMapDistance(3)); |
|
182 |
try { |
|
183 |
((VectorialData) laCapa).process(visitor); |
|
184 |
} catch (DriverException e) { |
|
185 |
throw new BehaviorException("No se pudo procesar la capa", |
|
186 |
e); |
|
187 |
} catch (VisitException e) { |
|
188 |
throw new RuntimeException(e); |
|
189 |
} |
|
190 |
} |
|
168 | 191 |
items[i] = new VectorialXMLItem(visitor.getBitSet(), laCapa); |
169 |
numLayersInfoable++;
|
|
192 |
*/
|
|
170 | 193 |
} |
171 | 194 |
// TODO: PROVISIONAL PARA LA CAPA WMS |
172 | 195 |
if (laCapa instanceof RasterOperations) { |
Also available in: Unified diff