### Question:
PostGIS implements VectorDriver<PostGISWorkspace> { @Override public PostGISWorkspace create(Map<?, Object> opts, Schema schema) throws IOException { throw new UnsupportedOperationException(); }  static PostGISWorkspace open(PostGISOpts opts); @Override boolean isEnabled(Messages messages); @Override String name(); @Override List<String> aliases(); @Override Class<PostGISWorkspace> type(); @Override List<Key<? extends Object>> keys(); @Override String family(); @Override boolean canOpen(Map<?, Object> opts, Messages msgs); @Override PostGISWorkspace open(Map<?, Object> opts); @Override boolean canCreate(Map<?, Object> opts, Messages msgs); @Override PostGISWorkspace create(Map<?, Object> opts, Schema schema); @Override Set<Capability> capabilities(); static final Key<String> DB; static final Key<String> SCHEMA; static final Key<String> HOST; static final Key<Integer> PORT; static final Key<String> USER; static final Key<Password> PASSWD; }### Answer:
@Test public void testCreate() throws Exception { Schema widgets = new SchemaBuilder("widgets").field("shape", Polygon.class) .field("name", String.class).field("cost", Double.class).schema(); PostGISDataset data = pg.create(widgets); assertEquals(0, data.count(new VectorQuery())); GeomBuilder gb = new GeomBuilder(); FeatureWriteCursor c = data.append(new VectorQuery()); Feature f = c.next(); f.put("shape", gb.point(0,0).point().buffer(10).get()); f.put("name", "bomb"); f.put("cost", 1.99); c.write(); f = c.next(); f.put("shape", gb.points(0,0,1,1).lineString().buffer(1).get()); f.put("name", "dynamite"); f.put("cost", 2.99); c.write(); f = c.next(); f.put("shape", gb.points(-5,5, 5,5, 2,-2, 3,-5, -3,-5, -2,-2, -5,5).ring().toPolygon()); f.put("name", "anvil"); f.put("cost", 3.99); c.write(); c.close(); data = pg.get("widgets"); assertEquals(3, data.count(new VectorQuery())); FeatureCursor d = data.read(new VectorQuery().filter("name = 'bomb'")); assertTrue(d.hasNext()); assertEquals(1.99, d.next().get("cost")); d.close(); }