s.close();
c.close();
DBSpatialSource source = new DBSpatialSource("127.0.0.1", 5432,
"orbiscad", "postgres", "", "nueva", "geom", "jdbc:postgresql");
DefaultSpatialDriverMetadata dsdm = new DefaultSpatialDriverMetadata();
dsdm.addSpatialField("geom", FShape.POINT);
String[] types = new String[]{"descomentar cuando haya driver de postgis"};//new PostGISDriver().getAvailableTypes();
for (int i = 0; i < types.length; i++) {
dsdm.addField("f" + i, types[i]);
}
/*
* CHAR, VARCHAR, LONGVARCHAR, BIGINT, BOOLEAN, BIT, DATE, DECIMAL,
* NUMERIC, FLOAT, DOUBLE, INTEGER, REAL, SMALLINT, TINYINT, BINARY,
* VARBINARY, LONGVARBINARY, TIMESTAMP, TIME
*/
dsdm.setPrimaryKey(new String[] { "f1" });
DBSourceCreation dbsc = new DBSourceCreation(source, dsdm);
ds.createDataSource(dbsc);
SpatialDataSource d = ds.getSpatialDataSource(source);
d.beginTrans();
assertTrue(d.getSpatialFieldIndex() == 16);