[Gvsig_desarrolladores] Teniendo el Point2D pReal como consigo elregistro entero?

Juan Lucas Dominguez Rubio jldominguez en prodevelop.es
Vie Nov 5 15:02:37 CET 2010


Hola, el objeto selection (FBitSet) contiene los índices de los elementos recopilados por el visitor. Puedes procesarlos con un bucle:
 
for(int i=selection.nextSetBit(0); i>=0; i=selection.nextSetBit(i+1)) {
 
Value[] fila = ds.getRow(i);
// aqui hacer cosas con "fila"
 
}
 
 
¿Es eso lo que necesitas?
 
 
Saludos,
Juan Lucas Domínguez Rubio
---
Prodevelop SL, Valencia (España)
Tlf.: 96.351.06.12 -- Fax: 96.351.09.68
http://www.prodevelop.es <http://www.prodevelop.es/> 
---

________________________________

De: gvsig_desarrolladores-bounces en listserv.gva.es en nombre de agirrearri
Enviado el: vie 05/11/2010 14:41
Para: gvsig_desarrolladores en listserv.gva.es
Asunto: [Gvsig_desarrolladores] Teniendo el Point2D pReal como consigo elregistro entero?




Hola, 
   estoy creado un formulario personalizado para una capa de arbolado (capa
de puntos). He conseguido conseguir el punto con el listener que me da la X
y el Y pero  ¿como puedo conseguir el registro entero para sacar la
información y poder mostrarla en el formularión?

He escrito este codigo pero no consigo sacar la información.

        public void point(PointEvent event) throws BehaviorException {

        Point2D pReal =
mapCtrl.getMapContext().getViewPort().toMapPoint(event.getPoint());

        /*
                 * We will use a Visitor pattern to query the layer and to obtain a
                 * FBitSet (the selected items). Then, we iterate thru selection and
                 * extract the needed information from the dataSource.
                 */
        QueryByPointVisitor visitor = new QueryByPointVisitor();
        FLayers lyrs = mapCtrl.getMapContext().getLayers();
       
         FLayer arbolado = lyrs.getLayer("arbolado");
         FLyrVect shpVect = (FLyrVect) arbolado;
                int numLayersInfoable = 0;
                double tol = mapCtrl.getViewPort().toMapDistance(3);
               
                visitor.setLayer(arbolado);
                visitor.setQueriedPoint(pReal);
                visitor.setTolerance(2.0);
          
                                try {
                                        ((VectorialData) arbolado).process(visitor);
                                        FBitSet selection = visitor.getBitSet();
                                        DataSource ds = ((AlphanumericData) arbolado).getRecordset();
                                      
............................................
                                        .........................
                                        .............

Estoy basandome en un ejemplo que trae el proyecto examples.
Gracias, atentamente Eñaut.
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Teniendo-el-Point2D-pReal-como-consigo-el-registro-entero-tp5708985p5708985.html
Sent from the gvSIG desarrolladores mailing list archive at Nabble.com.
_______________________________________________
gvSIG_desarrolladores mailing list
gvSIG_desarrolladores en listserv.gva.es
http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores


------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://listserv.gva.es/pipermail/gvsig_desarrolladores/attachments/20101105/0d1b2fdd/attachment.htm 


Más información sobre la lista de distribución gvSIG_desarrolladores