}
private LayerInfo createLayer(WorkspaceInfo ws, String csname, String covname, String covnname,
String covtitle, String lname) {
LayerInfo layer1;
CoverageStoreInfo coverageStore = catalog.getFactory().createCoverageStore();
coverageStore.setName(csname);
coverageStore.setWorkspace(ws);
catalog.add(coverageStore);
CoverageInfo coverage = catalog.getFactory().createCoverage();
coverage.setName(covname);
coverage.setNativeName(covnname);
coverage.setTitle(covtitle);
coverage.setStore(coverageStore);
// coverage.setNativeBoundingBox(new ReferencedEnvelope(0, 0, 0, 0,
// DefaultGeographicCRS.WGS84));
// coverage.setLatLonBoundingBox(new ReferencedEnvelope(0, 0, 0, 0,
// DefaultGeographicCRS.WGS84));
catalog.add(coverage);
layer1 = catalog.getFactory().createLayer();
layer1.setResource(coverage);
layer1.setName(lname);
logger.warn("LYID: " + layer1.getId());
logger.warn("COVERAGE: " + layer1.getResource());
logger.warn("COVSTORE: " + ((CoverageInfo) layer1.getResource()).getStore());
catalog.add(layer1);
return layer1;
}