[Gvsig_english] gvSIG gdbms shape driver

erwan bocher erwan.bocher at gmail.com
Tue Oct 10 09:53:50 CEST 2006


Hello,


I try to use GDBMS to read and write values and fields in a shapefile. I
used the code below. I have an error about
com.iver.cit.gvsig.fmap.drivers.shp.IndexedShpDriver.

//Ici on va chercher le ou les drivers necessaires driver
        LayerFactory.setDriversPath("C:/Temp/driver");

        Driver driver = LayerFactory.getDM().getDriver("gvSIG shp driver");

          if (driver!=null){ //Si le driver est trouvé alors on continue

              System.out.println(driver.getName()); //On affiche son petit
nom.

            LayerFactory.getDataSourceFactory().addFileDataSource("gvSIG shp
driver", "macouche",
            "C:/Temp/countries.shp");

            // SelectableDataSource permet de travailler sur la table

            SelectableDataSource sds = new SelectableDataSource(
LayerFactory.getDataSourceFactory().createRandomDataSource("macouche",
DataSourceFactory.MANUAL_OPENING));
            EditableAdapter ea = new EditableAdapter();
            ea.setOriginalDataSource(sds);

            ea.startEdition(0);
            IWriter writer = ea.getWriter();

            FieldDescription field = null;

            field.setFieldName("myfield");

            ea.addField(field);

            ea.stopEdition(writer, 0);

Thanks

R1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://runas.cap.gva.es/pipermail/gvsig_internacional/attachments/20061010/b88a7d92/attachment.htm


More information about the Gvsig_internacional mailing list