final String currentCoverageName = coverage.getName(); if (currentCoverageName == null || currentCoverageName.equalsIgnoreCase(coverageName)) { final DomainsType domains = coverage.getDomains(); if (domains != null) { final List<DomainType> domainList = domains.getDomain();
final Coverage coverage = reader.ancillaryFileManager.coveragesMapping.get(coverageName); final SchemaType schema = coverage.getSchema(); if (schema != null) {
coverage.setName(props.getProperty(Utils.Prop.NAME)); coverage.setName(props.getProperty(Utils.Prop.TYPENAME)); DomainsType domains = coverage.getDomains(); if (domains == null) { domains = Utils.OBJECT_FACTORY.createDomainsType(); coverage.setDomains(domains);
final Coverage coverage = reader.ancillaryFileManager.coveragesMapping.get(coverageName); final SchemaType schema = coverage.getSchema(); if (schema != null) {
final SchemaType schema = coverage.getSchema(); if (schema != null) {
String coverageName = coverageElement.getName(); if (coverageName == null) { coverageName = getCoverageNameFromCollector(coverageElement.getNameCollector()); String origName = coverageElement.getOrigName(); if (origName != null && !origName.isEmpty()) { origName = origName.trim(); final SchemaType coverageSchema = coverageElement.getSchema(); String coverageSchemaRef = null; String schemaAttributes = null;
coverage.setName(cov.getName()); coverage.setOrigName(cov.getOrigName()); coveragesList.add(coverage); coverage.setSchema(schema); final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());
coverage.setName(cov.getName()); coverage.setOrigName(cov.getOrigName()); coveragesList.add(coverage); coverage.setSchema(schema); final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());
String coverageName = coverageElement.getName(); if (coverageName == null) { coverageName = getCoverageNameFromCollector(coverageElement.getNameCollector()); String origName = coverageElement.getOrigName(); if (origName != null && !origName.isEmpty()) { origName = origName.trim(); 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; }
/** * @param varName * @return */ public boolean acceptsVariable(String varName) { Utilities.ensureNonNull("varName", varName); if(indexer==null){ return true; } for (Coverage filteringCoverage: indexer.getCoverages().getCoverage()) { if (varName.equalsIgnoreCase(filteringCoverage.getName()) || varName.equalsIgnoreCase(filteringCoverage.getOrigName())) { return true; } } return false; }
/** * Create a Coverage indexer object with the specified set of properties * * @param coverageName name of the coverage * @param origName name of the underlying variable * @param schemaAttributes schema definition attributes * @param schemaName schema name * @return */ private Coverage createCoverate( String coverageName, String origName, String schemaAttributes, String schemaName) { SchemaType schema = OBJECT_FACTORY.createSchemaType(); Coverage coverage = OBJECT_FACTORY.createIndexerCoveragesCoverage(); coverage.setOrigName(origName); coverage.setName(coverageName); coverage.setSchema(schema); schema.setAttributes(schemaAttributes); schema.setName(schemaName); return coverage; }
/** * Create a Coverage indexer object with the specified set of properties * @param coverageName name of the coverage * @param origName name of the underlying variable * @param schemaAttributes schema definition attributes * @param schemaName schema name * @return */ private Coverage createCoverate(String coverageName, String origName, String schemaAttributes, String schemaName) { SchemaType schema = OBJECT_FACTORY.createSchemaType(); Coverage coverage = OBJECT_FACTORY.createIndexerCoveragesCoverage(); coverage.setOrigName(origName); coverage.setName(coverageName); coverage.setSchema(schema); schema.setAttributes(schemaAttributes); schema.setName(schemaName); return coverage; }
/** * Return a {@link Name} representation of the coverage name * * @param varName * @return */ public Name getCoverageName(String varName) { final Collection<Coverage> coverages = coveragesMapping.values(); for (Coverage cov : coverages) { if (varName.equalsIgnoreCase(cov.getOrigName())) { return new NameImpl(cov.getName()); } } return null; }
/** * @param varName * @return */ public boolean acceptsVariable(String varName) { Utilities.ensureNonNull("varName", varName); if (indexer == null || indexer.getCoverages() == null) { return true; } for (Coverage filteringCoverage : indexer.getCoverages().getCoverage()) { if (varName.equalsIgnoreCase(filteringCoverage.getName()) || varName.equalsIgnoreCase(filteringCoverage.getOrigName())) { return true; } } return false; }
public String getTypeName(String coverageName) { return coveragesMapping.get(coverageName).getSchema().getName(); }
public String getTypeName(String coverageName) { return coveragesMapping.get(coverageName).getSchema().getName(); }