public String getTypeName(String coverageName) { return coveragesMapping.get(coverageName).getSchema().getName(); }
final Coverage coverage = reader.ancillaryFileManager.coveragesMapping.get(coverageName); final SchemaType schema = coverage.getSchema(); if (schema != null) {
final SchemaType coverageSchema = coverageElement.getSchema(); String coverageSchemaRef = null; String schemaAttributes = null;
final Coverage coverage = reader.ancillaryFileManager.coveragesMapping.get(coverageName); final SchemaType schema = coverage.getSchema(); if (schema != null) {
final SchemaType schema = coverage.getSchema(); if (schema != null) {
final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());
final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());
final SchemaType coverageSchema = coverageElement.getSchema(); String coverageSchemaRef = null; String schemaAttributes = null;
final SchemaType coverageSchema = coverageElement.getSchema(); String coverageSchemaRef = null; String schemaAttributes = null;
public SimpleFeatureType getIndexSchema( Name coverageName, CoordinateSystem coordinateSystem, boolean isShared) throws Exception { // get the name for this variable to check his coveragename final String _coverageName = coverageName.toString(); // get the coverage definition for this variable, at this stage this exists otherwise we // would have skipped it! final Coverage coverage = ancillaryFileManager.coveragesMapping.get(_coverageName); // now check the schema creation SchemaType schema = coverage.getSchema(); String schemaDef = schema != null ? schema.getAttributes() : null; // no schema was defined yet, let's create a default one if (schema == null || schema.getAttributes() == null) { // TODO incapsulate in coveragedescriptor schemaDef = suggestSchemaFromCoordinateSystem(coverage, coordinateSystem, isShared); // set the schema name to be the coverageName ancillaryFileManager.setSchema(coverage, coverage.getName(), schemaDef); schema = coverage.getSchema(); } String variableName = ancillaryFileManager.variablesMap.get(coverageName); CoordinateReferenceSystem crs = georeferencing.getCoordinateReferenceSystem(variableName); // create featuretype, the name is the CoverageName final SimpleFeatureType indexSchema = NetCDFUtilities.createFeatureType(coverage.getName(), schemaDef, crs); // create forceSchemaCreation(indexSchema); // return return indexSchema; }
/** * Add the default schema to this coverage * * @param coverage * @return */ public String setSchema(Coverage coverage, final String schemaName, final String schemaDef) { Utilities.ensureNonNull("coverage", coverage); Utilities.ensureNonNull("schemaName", schemaName); if (coverage != null) { SchemaType schema = coverage.getSchema(); if (schema == null) { schema = OBJECT_FACTORY.createSchemaType(); coverage.setSchema(schema); } schema.setName(schemaName); if (schemaDef != null) { schema.setAttributes(schemaDef); } return schemaName; } return null; }
public SimpleFeatureType getIndexSchema(Name coverageName, CoordinateSystem coordinateSystem) throws Exception { // get the name for this variable to check his coveragename final String _coverageName = coverageName.toString(); // get the coverage definition for this variable, at this stage this exists otherwise we would have skipped it! final Coverage coverage = ancillaryFileManager.coveragesMapping.get(_coverageName); // now check the schema creation SchemaType schema = coverage.getSchema(); String schemaDef=schema!=null?schema.getAttributes():null; // no schema was defined yet, let's create a default one if (schema == null||schema.getAttributes()==null) { // TODO incapsulate in coveragedescriptor schemaDef = suggestSchemaFromCoordinateSystem(coverage, coordinateSystem); //set the schema name to be the coverageName ancillaryFileManager.setSchema(coverage,coverage.getName(),schemaDef); schema = coverage.getSchema(); } // create featuretype, the name is the CoverageName final SimpleFeatureType indexSchema = UnidataUtilities.createFeatureType(coverage.getName(),schemaDef,UnidataCRSUtilities.WGS84); // create forceSchemaCreation(indexSchema); // return return indexSchema; }
/** * Add the default schema to this coverage * @param coverage * @return */ public String setSchema(Coverage coverage, final String schemaName, final String schemaDef) { Utilities.ensureNonNull("coverage", coverage); Utilities.ensureNonNull("schemaName", schemaName); if (coverage != null) { SchemaType schema = coverage.getSchema(); if (schema == null) { schema = OBJECT_FACTORY.createSchemaType(); coverage.setSchema(schema); } schema.setName(schemaName); if(schemaDef!=null){ schema.setAttributes(schemaDef); } return schemaName; } return null; }
public String getTypeName(String coverageName) { return coveragesMapping.get(coverageName).getSchema().getName(); }
public String getTypeName(String coverageName) { return coveragesMapping.get(coverageName).getSchema().getName(); }
final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());
public SimpleFeatureType getIndexSchema( Name coverageName, CoordinateSystem coordinateSystem, boolean isShared) throws Exception { // get the name for this variable to check his coveragename final String _coverageName = coverageName.toString(); // get the coverage definition for this variable, at this stage this exists otherwise we // would have skipped it! final Coverage coverage = ancillaryFileManager.coveragesMapping.get(_coverageName); // now check the schema creation SchemaType schema = coverage.getSchema(); String schemaDef = schema != null ? schema.getAttributes() : null; // no schema was defined yet, let's create a default one if (schema == null || schema.getAttributes() == null) { // TODO incapsulate in coveragedescriptor schemaDef = suggestSchemaFromCoordinateSystem(coverage, coordinateSystem, isShared); // set the schema name to be the coverageName ancillaryFileManager.setSchema(coverage, coverage.getName(), schemaDef); schema = coverage.getSchema(); } String variableName = ancillaryFileManager.variablesMap.get(coverageName); CoordinateReferenceSystem crs = georeferencing.getCoordinateReferenceSystem(variableName); // create featuretype, the name is the CoverageName final SimpleFeatureType indexSchema = NetCDFUtilities.createFeatureType(coverage.getName(), schemaDef, crs); // create forceSchemaCreation(indexSchema); // return return indexSchema; }
/** * Add the default schema to this coverage * * @param coverage * @return */ public String setSchema(Coverage coverage, final String schemaName, final String schemaDef) { Utilities.ensureNonNull("coverage", coverage); Utilities.ensureNonNull("schemaName", schemaName); if (coverage != null) { SchemaType schema = coverage.getSchema(); if (schema == null) { schema = OBJECT_FACTORY.createSchemaType(); coverage.setSchema(schema); } schema.setName(schemaName); if (schemaDef != null) { schema.setAttributes(schemaDef); } return schemaName; } return null; }
/** * Get a {@link SchemaType} element for the specified {@link Coverage}. The {@link Indexer} * object will be used in case of an externally referenced schema. * * @param indexer the main {@link Indexer} instance * @param coverage the {@link Coverage} element with the Schema to be returned. */ public static SchemaType getSchema(Indexer indexer, Coverage coverage) { Utilities.ensureNonNull("coverage", coverage); SchemaType schema = coverage.getSchema(); if (schema != null) { String schemaRef = schema.getRef(); if (schemaRef != null) { schema = getSchemaRef(indexer, schemaRef); if (schema != null) { return schema; } } return schema; } return null; }