private DimensionDescriptor addDimensionDescriptor( String name, String upperCase, String basePropertyName, String additionalPropertyName) { final String unitsName = upperCase.equalsIgnoreCase(Utils.TIME_DOMAIN) ? CoverageUtilities.UCUM.TIME_UNITS.getName() : upperCase.equalsIgnoreCase(Utils.ELEVATION_DOMAIN) ? CoverageUtilities.UCUM.ELEVATION_UNITS.getName() : "FIXME"; // TODO: ADD UCUM units Management final String unitsSymbol = upperCase.equalsIgnoreCase(Utils.TIME_DOMAIN) ? CoverageUtilities.UCUM.TIME_UNITS.getSymbol() : upperCase.equalsIgnoreCase(Utils.ELEVATION_DOMAIN) ? CoverageUtilities.UCUM.ELEVATION_UNITS.getSymbol() : "FIXME"; // TODO: ADD UCUM units Management final DimensionDescriptor dimensionDescriptor = new DefaultDimensionDescriptor( name, unitsName, unitsSymbol, basePropertyName, additionalPropertyName); dimensions.add(dimensionDescriptor); return dimensionDescriptor; }
final String updatedAttribute = attributeDescriptor.getLocalName(); if (!updatedAttribute.equals( ((DefaultDimensionDescriptor) descriptor).getStartAttribute())) { ((DefaultDimensionDescriptor) descriptor).setStartAttribute(updatedAttribute);
/** * @param cv * @param dimensions * @throws IOException */ private void initTemporalDomain(CoordinateVariable<?> cv, List<DimensionDescriptor> dimensions) throws IOException { if (!cv.getType().equals(Date.class)) { throw new IllegalArgumentException( "Unable to init temporal domain from CoordinateVariable that does not bind to Date"); } if (!(cv.getCoordinateReferenceSystem() instanceof TemporalCRS)) { throw new IllegalArgumentException( "Unable to init temporal domain from CoordinateVariable that does not have a TemporalCRS"); } this.setHasTemporalDomain(true); final UnidataTemporalDomain temporalDomain = new UnidataTemporalDomain(cv); this.setTemporalDomain(temporalDomain); String timeAttribute = reader.uniqueTimeAttribute ? NetCDFUtilities.TIME : cv.getName(); dimensions.add( new DefaultDimensionDescriptor( Utils.TIME_DOMAIN, CoverageUtilities.UCUM.TIME_UNITS.getName(), CoverageUtilities.UCUM.TIME_UNITS.getSymbol(), timeAttribute, null)); }
final String updatedAttribute = attributeDescriptor.getLocalName(); if (!updatedAttribute.equals(((DefaultDimensionDescriptor) descriptor) .getStartAttribute())) { ((DefaultDimensionDescriptor) descriptor).setStartAttribute(updatedAttribute);
new DefaultDimensionDescriptor( cv.getName(), CoverageUtilities.UCUM.TIME_UNITS.getName(), new DefaultDimensionDescriptor( cv.getName(), cv.getUnit(), cv.getUnit(), cv.getName(), null)); } else {
final String updatedAttribute = attributeDescriptor.getLocalName(); if (!updatedAttribute.equals( ((DefaultDimensionDescriptor) descriptor).getStartAttribute())) { ((DefaultDimensionDescriptor) descriptor).setStartAttribute(updatedAttribute);
/** * @param cv * @param dimensions * @throws IOException */ private void initVerticalDomain(CoordinateVariable<?> cv, List<DimensionDescriptor> dimensions) throws IOException { this.setHasVerticalDomain(true); final UnidataVerticalDomain verticalDomain = new UnidataVerticalDomain(cv); this.setVerticalDomain(verticalDomain); // TODO: Map ZAxis unit to UCUM UNIT (depending on type... elevation, level, pressure, ...) dimensions.add( new DefaultDimensionDescriptor( Utils.ELEVATION_DOMAIN, cv.getUnit(), CoverageUtilities.UCUM.ELEVATION_UNITS.getSymbol(), cv.getName(), null)); }
private void addAdditionalDomain(List<CoordinateVariable<?>> otherAxes, List<DimensionDescriptor> dimensions) { if (otherAxes == null||otherAxes.isEmpty()) { return; } final List<AdditionalDomain> additionalDomains = new ArrayList<AdditionalDomain>(otherAxes.size()); this.setAdditionalDomains(additionalDomains); for(CoordinateVariable<?> cv :otherAxes){ // create domain UnidataAdditionalDomain domain; try { domain = new UnidataAdditionalDomain(cv); additionalDomains.add(domain); // TODO: Parse Units from axis and map them to UCUM units dimensions.add(new DefaultDimensionDescriptor(cv.getName(), "FIXME_UNIT", "FIXME_UNITSYMBOL", cv.getName(), null)); this.setHasAdditionalDomains(true); } catch (IOException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } }
/** * @param cv * @param dimensions * @throws IOException */ private void initTemporalDomain(CoordinateVariable<?> cv, List<DimensionDescriptor> dimensions) throws IOException { if(!cv.getType().equals(Date.class)){ throw new IllegalArgumentException("Unable to init temporal domani from CoordinateVariable that does not bind to Date"); } if(!(cv.getCoordinateReferenceSystem() instanceof TemporalCRS)){ throw new IllegalArgumentException("Unable to init temporal domani from CoordinateVariable that does not have a TemporalCRS"); } this.setHasTemporalDomain(true); final UnidataTemporalDomain temporalDomain = new UnidataTemporalDomain(cv); this.setTemporalDomain(temporalDomain); //TODO: Fix that once schema attributes to dimension mapping is merged from Simone's code dimensions.add(new DefaultDimensionDescriptor(Utils.TIME_DOMAIN, CoverageUtilities.UCUM.TIME_UNITS.getName(), CoverageUtilities.UCUM.TIME_UNITS.getSymbol(), cv.getName(), null)); }
/** * @param cv * @param dimensions * @throws IOException */ private void initVerticalDomain(CoordinateVariable<?> cv, List<DimensionDescriptor> dimensions) throws IOException { this.setHasVerticalDomain(true); final UnidataVerticalDomain verticalDomain = new UnidataVerticalDomain(cv); this.setVerticalDomain(verticalDomain); //TODO: Map ZAxis unit to UCUM UNIT (depending on type... elevation, level, pressure, ...) dimensions.add(new DefaultDimensionDescriptor(Utils.ELEVATION_DOMAIN, cv.getUnit(), CoverageUtilities.UCUM.ELEVATION_UNITS.getSymbol(), cv.getName(), null)); }
/** * @param cv * @param dimensions * @throws IOException */ private void initTemporalDomain(CoordinateVariable<?> cv, List<DimensionDescriptor> dimensions) throws IOException { if (!cv.getType().equals(Date.class)) { throw new IllegalArgumentException( "Unable to init temporal domain from CoordinateVariable that does not bind to Date"); } if (!(cv.getCoordinateReferenceSystem() instanceof TemporalCRS)) { throw new IllegalArgumentException( "Unable to init temporal domain from CoordinateVariable that does not have a TemporalCRS"); } this.setHasTemporalDomain(true); final UnidataTemporalDomain temporalDomain = new UnidataTemporalDomain(cv); this.setTemporalDomain(temporalDomain); String timeAttribute = reader.uniqueTimeAttribute ? NetCDFUtilities.TIME : cv.getName(); dimensions.add( new DefaultDimensionDescriptor( Utils.TIME_DOMAIN, CoverageUtilities.UCUM.TIME_UNITS.getName(), CoverageUtilities.UCUM.TIME_UNITS.getSymbol(), timeAttribute, null)); }
/** * @param cv * @param dimensions * @throws IOException */ private void initVerticalDomain(CoordinateVariable<?> cv, List<DimensionDescriptor> dimensions) throws IOException { this.setHasVerticalDomain(true); final UnidataVerticalDomain verticalDomain = new UnidataVerticalDomain(cv); this.setVerticalDomain(verticalDomain); // TODO: Map ZAxis unit to UCUM UNIT (depending on type... elevation, level, pressure, ...) dimensions.add( new DefaultDimensionDescriptor( Utils.ELEVATION_DOMAIN, cv.getUnit(), CoverageUtilities.UCUM.ELEVATION_UNITS.getSymbol(), cv.getName(), null)); }
new DefaultDimensionDescriptor( cv.getName(), CoverageUtilities.UCUM.TIME_UNITS.getName(), new DefaultDimensionDescriptor( cv.getName(), cv.getUnit(), cv.getUnit(), cv.getName(), null)); } else {