@Test public void testMultiPolygonAndLinearRing() throws GeometryOperationFailedException { GeometryIndexOperation operation = new InsertGeometryOperation(service, new Geometry(Geometry.LINEAR_RING, 0, 0)); try { operation.execute(multiPolygon, service.create(GeometryIndexType.TYPE_GEOMETRY, 0)); Assert.fail(); } catch (GeometryOperationFailedException e) { } }
@Override public Geometry execute(Geometry geometry, GeometryIndex index) throws GeometryOperationFailedException { this.index = index; if (service.getType(index) != GeometryIndexType.TYPE_GEOMETRY) { throw new GeometryOperationFailedException("Index of wrong type. Must be TYPE_GEOMETRY."); } try { insert(geometry, index, child); return geometry; } catch (GeometryIndexNotFoundException e) { throw new GeometryOperationFailedException(e); } }
InsertGeometryOperation implements GeometryIndexOperation { @Override public Geometry execute(Geometry geometry, GeometryIndex index) throws GeometryOperationFailedException { this.index = index; if (service.getType(index) != GeometryIndexType.TYPE_GEOMETRY) { throw new GeometryOperationFailedException("Index of wrong type. Must be TYPE_GEOMETRY."); } try { insert(geometry, index, child); return geometry; } catch (GeometryIndexNotFoundException e) { throw new GeometryOperationFailedException(e); } } }
InsertGeometryOperation implements GeometryIndexOperation { @Override public Geometry execute(Geometry geometry, GeometryIndex index) throws GeometryOperationFailedException { this.index = index; if (service.getType(index) != GeometryIndexType.TYPE_GEOMETRY) { throw new GeometryOperationFailedException("Index of wrong type. Must be TYPE_GEOMETRY."); } try { insert(geometry, index, child); return geometry; } catch (GeometryIndexNotFoundException e) { throw new GeometryOperationFailedException(e); } } InsertGeometryOperation(GeometryIndexService service, Geometry child); }
InsertGeometryOperation implements GeometryIndexOperation { @Override public Geometry execute(Geometry geometry, GeometryIndex index) throws GeometryOperationFailedException { this.index = index; if (service.getType(index) != GeometryIndexType.TYPE_GEOMETRY) { throw new GeometryOperationFailedException("Index of wrong type. Must be TYPE_GEOMETRY."); } try { insert(geometry, index, child); return geometry; } catch (GeometryIndexNotFoundException e) { throw new GeometryOperationFailedException(e); } } InsertGeometryOperation(GeometryIndexService service, Geometry child); @Override Geometry execute(Geometry geometry, GeometryIndex index); @Override GeometryIndexOperation getInverseOperation(); @Override GeometryIndex getGeometryIndex(); }
InsertGeometryOperation implements GeometryIndexOperation { @Override public Geometry execute(Geometry geometry, GeometryIndex index) throws GeometryOperationFailedException { this.index = index; if (service.getType(index) != GeometryIndexType.TYPE_GEOMETRY) { throw new GeometryOperationFailedException("Index of wrong type. Must be TYPE_GEOMETRY."); } try { insert(geometry, index, child); return geometry; } catch (GeometryIndexNotFoundException e) { throw new GeometryOperationFailedException(e); } } InsertGeometryOperation(GeometryIndexService service, Geometry child); @Override Geometry execute(Geometry geometry, GeometryIndex index); @Override GeometryIndexOperation getInverseOperation(); @Override GeometryIndex getGeometryIndex();  }