[Gvsig_desarrolladores] Pintarsólo algunos elementos de un shape
Maria Arias de Reyna
marias en emergya.es
Jue Ene 15 13:59:54 CET 2009
El Jueves 15 Enero 2009 13:39, Oscar Garcia escribió:
> driverShp.getShape(index) para el acceso a geometrías.
> Y para acceder al FullExtent que es el bounding box
> driverShp.getFullExtent()
Me gustaría poder relacionar la geometría con los atributos definidos en el
shape.
Accediendo con el getShape(index) consigo llegar a las geometrías y las puedo
recorrer:
IndexedShpDriver vfd = (IndexedShpDriver) LayerFactory.getDM()
.getDriver("gvSIG shp driver");
File f = new File(path);
vfd.open(f);
vfd.initialize();
for (int i = 0; i < vfd.getShapeCount(); i++) {
IGeometry g = vfd.getShape(i);
}
También he conseguido acceder a los atributos a través del código que puse en
el primer mensaje:
FLayer l = LayerFactory.createLayer("route",
(VectorialFileDriver)
LayerFactory.getDM().getDriver(
"gvSIG shp driver"), new
File(path), CRSFactory
.getCRS("EPSG:23030"));
try {
SelectableDataSource sds =
((AlphanumericData)l).getRecordset();
Pero no consigo relacionar los datos que consigo en uno y en otro bucle.
--
María Arias de Reyna Domínguez
Emergya Consultoría
Más información sobre la lista de distribución gvSIG_desarrolladores