/** * Get the list of Names for the underlying coverage list * * @return */ public List<Name> getCoveragesNames() { final List<Name> names = new ArrayList<Name>(); Collection<Coverage> coverages = coveragesMapping.values(); for (Coverage cov : coverages) { names.add(new NameImpl(cov.getName())); } return names; }
private Coverage addCoverage(Coverage coverage) { if (variablesMap == null) { variablesMap = new HashMap<Name, String>(); coveragesMapping = new HashMap<String, Coverage>(); } coveragesMapping.put(coverage.getName(), coverage); variablesMap.put(new NameImpl(coverage.getName()), coverage.getOrigName()); 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; }
String coverageName = coverageElement.getName(); if (coverageName == 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; }
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; }
/** * @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; }
/** * 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; }
/** * Get the list of Names for the underlying coverage list * @return */ public List<Name> getCoveragesNames() { final List<Name> names = new ArrayList<Name>(); Collection<Coverage> coverages = coveragesMapping.values(); for (Coverage cov: coverages) { names.add(new NameImpl(cov.getName())); } return names; }
private Coverage addCoverage(Coverage coverage) { if (variablesMap == null) { variablesMap = new HashMap<Name, String>(); coveragesMapping = new HashMap<String, Coverage>(); } coveragesMapping.put(coverage.getName(), coverage); variablesMap.put(new NameImpl(coverage.getName()), coverage.getOrigName()); return coverage; }
/** * Return a {@link Name} representation of the coverage name * @param varName * @return */ 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; }
/** * Get the list of Names for the underlying coverage list * * @return */ public List<Name> getCoveragesNames() { final List<Name> names = new ArrayList<Name>(); Collection<Coverage> coverages = coveragesMapping.values(); for (Coverage cov : coverages) { names.add(new NameImpl(cov.getName())); } return names; }
private Coverage addCoverage(Coverage coverage) { if (variablesMap == null) { variablesMap = new HashMap<Name, String>(); coveragesMapping = new HashMap<String, Coverage>(); } coveragesMapping.put(coverage.getName(), coverage); variablesMap.put(new NameImpl(coverage.getName()), coverage.getOrigName()); return coverage; }
final String currentCoverageName = coverage.getName(); if (currentCoverageName == null || currentCoverageName.equalsIgnoreCase(coverageName)) {
String coverageName = coverageElement.getName(); if (coverageName == null) {
coverage.setName(cov.getName()); coverage.setOrigName(cov.getOrigName()); coveragesList.add(coverage);
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; }
/** * Return an indexer {@link Coverage} object from the specified {@link Indexer}, referring to * the requested name. * * @param indexer the main {@link Indexer} instance * @param name the name of the {@link Coverage} element to be retrieved. * @return the {@link Coverage} element for the specified name (if any). */ public static Coverage getCoverage(Indexer indexer, String name) { Coverages coverages = indexer.getCoverages(); if (coverages != null) { List<Coverage> coverageList = coverages.getCoverage(); for (Coverage coverage : coverageList) { String coverageName = coverage.getName(); if (coverageName != null && coverageName.equalsIgnoreCase(name)) { return coverage; } } } 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; }