/** * Get the schema with the specified name * * @param name * @return */ public String getSchema(String name) { // return schema; SchemasType schemas = indexer.getSchemas(); if (schemas != null) { List<SchemaType> schemaList = schemas.getSchema(); for (SchemaType schema : schemaList) { if (schema.getName().equalsIgnoreCase(name)) { return schema.getAttributes(); } } } return null; }
/** * Retrieve basic indexer properties by scanning the indexer XML instance. * * @throws JAXBException */ protected void initIndexer() throws JAXBException { if (indexerFile.exists() && indexerFile.canRead()) { Unmarshaller unmarshaller = CONTEXT.createUnmarshaller(); if (unmarshaller != null) { indexer = (Indexer) unmarshaller.unmarshal(indexerFile); // indexed information about dimensions that supports multiple bands initMultipleBandsDimensionsInfo(indexer); // Parsing schemas final SchemasType schemas = indexer.getSchemas(); Map<String, String> schemaMapping = new HashMap<String, String>(); if (schemas != null) { // Map schema names to schema attributes string List<SchemaType> schemaElements = schemas.getSchema(); for (SchemaType schemaElement : schemaElements) { schemaMapping.put(schemaElement.getName(), schemaElement.getAttributes()); } } // Parsing properties collectors initPropertiesCollectors(); // Parsing coverages initCoverages(schemaMapping); } } }
if (coverageSchema != null) { imposedSchema = true; schemaAttributes = coverageSchema.getAttributes(); coverageSchemaRef = coverageSchema.getRef();
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; }
coverage.setSchema(schema); final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());
schemaAttributes = schema.getAttributes(); } else if (schemas != null) { List<SchemaType> schemaList = schemas.getSchema(); schemaAttributes = schemaList.get(0).getAttributes();
/** * Retrieve basic indexer properties by scanning the indexer XML instance. * @throws JAXBException */ private void initIndexer() throws JAXBException { if (indexerFile.exists() && indexerFile.canRead()) { Unmarshaller unmarshaller = CONTEXT.createUnmarshaller(); if (unmarshaller != null) { indexer = (Indexer) unmarshaller.unmarshal(indexerFile); // Parsing schemas final SchemasType schemas = indexer.getSchemas(); Map<String, String> schemaMapping = new HashMap<String, String>(); if (schemas != null) { // Map schema names to schema attributes string List<SchemaType> schemaElements = schemas.getSchema(); for (SchemaType schemaElement: schemaElements) { schemaMapping.put(schemaElement.getName(), schemaElement.getAttributes()); } } // Parsing properties collectors initPropertiesCollectors(); // Parsing coverages initCoverages(schemaMapping); } } }
/** * Retrieve basic indexer properties by scanning the indexer XML instance. * * @throws JAXBException */ private void initIndexer() throws JAXBException { if (indexerFile.exists() && indexerFile.canRead()) { Unmarshaller unmarshaller = CONTEXT.createUnmarshaller(); if (unmarshaller != null) { indexer = (Indexer) unmarshaller.unmarshal(indexerFile); // indexed information about dimensions that supports multiple bands initMultipleBandsDimensionsInfo(indexer); // Parsing schemas final SchemasType schemas = indexer.getSchemas(); Map<String, String> schemaMapping = new HashMap<String, String>(); if (schemas != null) { // Map schema names to schema attributes string List<SchemaType> schemaElements = schemas.getSchema(); for (SchemaType schemaElement : schemaElements) { schemaMapping.put(schemaElement.getName(), schemaElement.getAttributes()); } } // Parsing properties collectors initPropertiesCollectors(); // Parsing coverages initCoverages(schemaMapping); } } }
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; }
if (coverageSchema != null) { imposedSchema = true; schemaAttributes = coverageSchema.getAttributes(); coverageSchemaRef = coverageSchema.getRef();
if (coverageSchema != null) { imposedSchema = true; schemaAttributes = coverageSchema.getAttributes(); coverageSchemaRef = coverageSchema.getRef();
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; }
coverage.setSchema(schema); final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());
coverage.setSchema(schema); final SchemaType inputSchema = cov.getSchema(); schema.setAttributes(inputSchema.getAttributes()); schema.setName(inputSchema.getName());