public void insert(GeogigTransaction transaction, Feature... features) throws Exception { for (Feature f : features) { insert(transaction, f); } }
@Test public void testTwoStaged() { try { super.insert(points2); super.insertAndAdd(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(3, summary.getCountStaged()); }
/** * Inserts the feature to the index but does not stages it to be committed */ public ObjectId insert(Feature f) throws Exception { return insert(null, f); }
@Test public void testTwoStaged() { try { super.insert(points2); super.insertAndAdd(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(3, summary.getCountStaged()); }
public void insert(GeogigTransaction transaction, Feature... features) throws Exception { for (Feature f : features) { insert(transaction, f); } }
/** * Inserts the feature to the index but does not stages it to be committed */ public ObjectId insert(Feature f) throws Exception { return insert(null, f); }
public void insert(Feature... features) throws Exception { insert(null, features); }
public void insert(Feature... features) throws Exception { insert(null, features); }
public void insertAndAdd(GeogigTransaction transaction, Feature... features) throws Exception { insert(transaction, features); geogig.command(AddOp.class).call(); }
public void insertAndAdd(GeogigTransaction transaction, Feature... features) throws Exception { insert(transaction, features); geogig.command(AddOp.class).call(); }
/** * Inserts the Feature to the index and stages it to be committed. */ public ObjectId insertAndAdd(GeogigTransaction transaction, Feature f) throws Exception { ObjectId objectId = insert(transaction, f); if (transaction != null) { transaction.command(AddOp.class).call(); } else { geogig.command(AddOp.class).call(); } return objectId; }
/** * Inserts the Feature to the index and stages it to be committed. */ public ObjectId insertAndAdd(GeogigTransaction transaction, Feature f) throws Exception { ObjectId objectId = insert(transaction, f); if (transaction != null) { transaction.command(AddOp.class).call(); } else { geogig.command(AddOp.class).call(); } return objectId; }
@Test public void testOneAdd() { try { super.insert(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(2, summary.getCountUnstaged()); }
@Test public void testOneAdd() { try { super.insert(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(2, summary.getCountUnstaged()); }
/** * Make sure a spatial query against a geometry attribute that does not define a CRS just * assumes the query is in the native CRS */ @Test public void testSpatialQueryOnNullCrsAttribute() throws Exception { final String typeName = "nullcrs"; final SimpleFeatureType type = DataUtilities.createType(typeName, "the_geom:Point,name:String"); assertNull(type.getGeometryDescriptor().getCoordinateReferenceSystem()); List<Feature> features = new ArrayList<>(); for (int i = 0; i < 3; i++) { Feature f = super.feature(type, String.valueOf(i), String.format("POINT(%d %d)", i, i), "f-" + i); features.add(f); } super.insert(features); super.add(); super.commit("created feature type with null CRS"); SimpleFeatureSource source = dataStore.getFeatureSource(typeName); assertNull(source.getSchema().getGeometryDescriptor().getCoordinateReferenceSystem()); Filter bbox; SimpleFeatureCollection coll; bbox = ff.bbox("the_geom", -0.5, -0.5, 0.5, 0.5, "EPSG:4326"); coll = source.getFeatures(bbox); assertEquals(1, coll.size()); bbox = ff.bbox("the_geom", -0.5, -0.5, 0.5, 0.5, "EPSG:3857"); coll = source.getFeatures(bbox); assertEquals(1, coll.size()); }
/** * Make sure a spatial query against a geometry attribute that does not define a CRS just * assumes the query is in the native CRS */ @Test public void testSpatialQueryOnNullCrsAttribute() throws Exception { final String typeName = "nullcrs"; final SimpleFeatureType type = DataUtilities.createType(typeName, "the_geom:Point,name:String"); assertNull(type.getGeometryDescriptor().getCoordinateReferenceSystem()); List<Feature> features = new ArrayList<>(); for (int i = 0; i < 3; i++) { Feature f = super.feature(type, String.valueOf(i), String.format("POINT(%d %d)", i, i), "f-" + i); features.add(f); } super.insert(features); super.add(); super.commit("created feature type with null CRS"); SimpleFeatureSource source = dataStore.getFeatureSource(typeName); assertNull(source.getSchema().getGeometryDescriptor().getCoordinateReferenceSystem()); Filter bbox; SimpleFeatureCollection coll; bbox = ff.bbox("the_geom", -0.5, -0.5, 0.5, 0.5, "EPSG:4326"); coll = source.getFeatures(bbox); assertEquals(1, coll.size()); bbox = ff.bbox("the_geom", -0.5, -0.5, 0.5, 0.5, "EPSG:3857"); coll = source.getFeatures(bbox); assertEquals(1, coll.size()); }