Package opendap.dap

Examples of opendap.dap.Attribute


        // store attribute name, all values for ALL attributes (strings and numerics)
        ProcessingInstructions processingInstructions = config.getProcessingInstructions();
        if (attName.equals(NC_GLOBAL)) {
          while (e.hasMoreElements()) {
            String key = e.nextElement();
            Attribute att = at.getAttribute(key);
            // convert all DAS attribute names to lower case
            String lkey = key.toLowerCase();
           
            // look for global attribute name in date/time configuration specification
            String dateTimeFormatKey = OpendapConfigMetKeys.DATETIME_FORMAT_ATTR + ":" + lkey;
            String dateTimeFormatValue = processingInstructions.getInstructionValue(dateTimeFormatKey);
            // add this attribute as properly formatted date/time
            if (StringUtils.hasText(dateTimeFormatValue)) {
              DateFormat inFormat = new SimpleDateFormat(dateTimeFormatValue);
              Enumeration<String> edt = att.getValues();
              while (edt.hasMoreElements()) {
                String value = edt.nextElement();
                try {
                  Date date = inFormat.parse(value);
                  ProfileUtils.addIfNotNull(metadata, lkey, outputDatetimeFormat.format(date));
                } catch(ParseException pe) {
                  LOG.log(Level.WARNING,
                          "Error parsing date/time from DAS attribute: "+key+" value="+value+" error="+pe.getMessage());
                }
              }
            // add this global attribute as string
            } else {
              ProfileUtils.addIfNotExisting(metadata, lkey, att.getValues());
            }
          }
         
        // NetCDF coordinates
        } else {
         
          if (   attName.equalsIgnoreCase("lat") || attName.equalsIgnoreCase("latitude")
              || attName.equalsIgnoreCase("lon") || attName.equalsIgnoreCase("longitude")
              || attName.equalsIgnoreCase("time")
              || attName.equalsIgnoreCase("alt") || attName.equalsIgnoreCase("altitude")
              || attName.equalsIgnoreCase("lev") || attName.equalsIgnoreCase("level")
              || attName.equalsIgnoreCase("depth")
              ) {
           
            if (!excludedVariables.contains(attName)) {
              // store coordinate name
              ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.COORDINATES, attName);
            }
           
          } else if (attName.toLowerCase().startsWith("time_") || attName.toLowerCase().endsWith("_time")) {
           
            // ignore for now - it's not a coordinate neither a variable you would want to search on
           
          // NetCDF variables
          } else {
           
            if (!excludedVariables.contains(attName)) {
              // store variable name
              ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.VARIABLES, attName);
              // store "standard_name", "long_name"
              while (e.hasMoreElements()) {
                String key = e.nextElement();
                Attribute att = at.getAttribute(key);
                if (key.equalsIgnoreCase(STANDARD_NAME)) {
                  ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.CF_STANDARD_NAMES, att.getValueAt(0));
                } else if (key.equalsIgnoreCase(LONG_NAME)) {
                  ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.VARIABLES_LONG_NAMES, att.getValueAt(0));
                }          
              } 
            }
           
          }
View Full Code Here


    Enumeration attributeNames = attTable.getNames();

    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
    
      if (!attr.isContainer()) {
         Enumeration attrValues = null;
       
          try {
            attrValues = attr.getValues();
          } catch (NoSuchAttributeException e) {
            e.printStackTrace();
            LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
                + "] failed: Message: " + e.getMessage());
            continue;
View Full Code Here

    }

    Enumeration attributeNames = attTable.getNames();
    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
            + "] failed: Message: " + e.getMessage());
        continue;
      }
View Full Code Here

    Enumeration attributeNames = attTable.getNames();

    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        e.printStackTrace();
        LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
            + "] failed: Message: " + e.getMessage());
        continue;
View Full Code Here

    }

    Enumeration attributeNames = attTable.getNames();
    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
            + "] failed: Message: " + e.getMessage());
        continue;
      }
View Full Code Here

    Enumeration attributeNames = attTable.getNames();

    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
    
      if (!attr.isContainer()) {
         Enumeration attrValues = null;
       
          try {
            attrValues = attr.getValues();
          } catch (NoSuchAttributeException e) {
            e.printStackTrace();
            LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
                + "] failed: Message: " + e.getMessage());
            continue;
View Full Code Here

    }

    Enumeration attributeNames = attTable.getNames();
    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
            + "] failed: Message: " + e.getMessage());
        continue;
      }
View Full Code Here

TOP

Related Classes of opendap.dap.Attribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.