final Coverage coverage = reader.ancillaryFileManager.coveragesMapping.get(coverageName);
final SchemaType schema = coverage.getSchema();
if (schema != null) {
// look up the name
String schName= schema.getName();
final CoverageSlicesCatalog catalog = reader.getCatalog();
if (catalog != null) {
// Current assumption is that we have a typeName for each coverage but we should keep on working
// with shared schemas
// try with coveragename
SimpleFeatureType schemaType = null;
try{
if(schName!=null){
schemaType=catalog.getSchema(schName);
}
}catch (IOException e) {
// ok, we did not use the schema name, let's use the coverage name
schemaType = catalog.getSchema(coverageName);
}
if (schemaType != null) {
// Schema found: proceed with remapping attributes
updateMapping(schemaType, dimensionDescriptors);
indexSchema = schemaType;