Package aQute.bnd.header

Examples of aQute.bnd.header.Attrs$DataType


  // read each field, check datatype
  private void checkData(StructureData sdata) {

    for (StructureMembers.Member member : sdata.getMembers()) {
      DataType dt = member.getDataType();
      if (dt == DataType.FLOAT) {
        sdata.getScalarFloat(member);
        sdata.getJavaArrayFloat(member);
      } else if (dt == DataType.DOUBLE) {
        sdata.getScalarDouble(member);
View Full Code Here


  }

  private void testData( StructureData sdata) {

    for (StructureMembers.Member member : sdata.getMembers()) {
      DataType dt = member.getDataType();
      if (dt == DataType.FLOAT) {
        sdata.getScalarFloat(member);
        sdata.getJavaArrayFloat(member);
      } else if (dt == DataType.DOUBLE) {
        sdata.getScalarDouble(member);
        sdata.getJavaArrayDouble(member);
      } else if (dt == DataType.BYTE) {
        sdata.getScalarByte(member);
        sdata.getJavaArrayByte(member);
      } else if (dt == DataType.SHORT) {
        sdata.getScalarShort(member);
        sdata.getJavaArrayShort(member);
      } else if (dt == DataType.INT) {
        sdata.getScalarInt(member);
        sdata.getJavaArrayInt(member);
      } else if (dt == DataType.LONG) {
        sdata.getScalarLong(member);
        sdata.getJavaArrayLong(member);
      } else if (dt == DataType.CHAR) {
        sdata.getScalarChar(member);
        sdata.getJavaArrayChar(member);
        sdata.getScalarString(member);
      } else if (dt == DataType.STRING) {
        sdata.getScalarString(member);
      }

      if (dt.isNumeric()) {
        sdata.convertScalarDouble(member.getName());
      }

    }
  }
View Full Code Here

  }

  private void testData( StructureData sdata) {

    for (StructureMembers.Member member : sdata.getMembers()) {
      DataType dt = member.getDataType();
      if (dt == DataType.FLOAT) {
        sdata.getScalarFloat(member);
        sdata.getJavaArrayFloat(member);
      } else if (dt == DataType.DOUBLE) {
        sdata.getScalarDouble(member);
View Full Code Here

     *
     * @see NetcdfImageReader#getRawDataType
     */
    public static int getRawDataType(final VariableIF variable) {
        VariableDS ds = (VariableDS) variable;
        final DataType type = ds.getOriginalDataType();
        return transcodeNetCDFDataType(type,variable.isUnsigned());
    }
View Full Code Here

        } else if (checkType == CheckType.NOSCALARS) {
            List<Dimension> dimensions = var.getDimensions();
            if (dimensions.size()<2) {
                return false;
            }
            DataType dataType = var.getDataType();
            if (dataType == DataType.CHAR) {
                return false;
            }
            return isVariableAccepted(var.getFullName(), CheckType.NONE);
        } else if (checkType == CheckType.ONLYGEOGRIDS) {
            List<Dimension> dimensions = var.getDimensions();
            if (dimensions.size()<2) {
                return false;
            }
            int twoDimensionalCoordinates = 0;
            for( Dimension dimension : dimensions ) {
                String dimName = dimension.getFullName();
                // check the dimension to be defined
                Group group = dimension.getGroup();
                // Simple check if the group is not present. In that case false is returned.
                // This situation could happen with anonymous dimensions inside variables which
                // indicates the bounds of another variable. These kind of variable are not useful
                // for displaying the final raster.
                if(group == null){
                    return false;
                }
                Variable dimVariable = group.findVariable(dimName);
                if (dimVariable == null) {
                    return false;
                }
                if (dimVariable instanceof CoordinateAxis1D) {
                    CoordinateAxis1D axis = (CoordinateAxis1D) dimVariable;
                    AxisType axisType = axis.getAxisType();
                    if (axisType == null) {
                        return false;
                    }
                    switch (axisType) {
                    case GeoX:
                    case GeoY:
                    case Lat:
                    case Lon:
                        twoDimensionalCoordinates++;
                        break;
                    default:
                        break;
                    }
                }
            }
            if (twoDimensionalCoordinates < 2) {
                // 2D Grid is missing
                return false;
            }

            DataType dataType = var.getDataType();
            if (dataType == DataType.CHAR) {
                return false;
            }
            return isVariableAccepted(var.getFullName(), CheckType.NONE);
        } else
View Full Code Here

        case Lat:
        case Lon:
        case Pressure:
        case Spectral:
            // numeric ?
            @SuppressWarnings("deprecation")
            final DataType dataType = coordinateAxis.getDataType();
            // scale and offset are there?
            Attribute scaleFactor = coordinateAxis.findAttribute("scale_factor");
            Attribute offsetFactor = coordinateAxis.findAttribute("offset");
            if (scaleFactor != null || offsetFactor != null) {
View Full Code Here

            throw new IllegalArgumentException("The requested variable doesn't exists: " + sampleGranule.getName());
        }
       
        // Get the data type for a sample image (All granules of the same coverage will use
        final int imageDataType = sampleGranule.getRenderedImage().getSampleModel().getDataType();
        final DataType netCDFDataType = NCUtilities.transcodeImageDataType(imageDataType);
        final Array matrix = NCUtilities.getArray(dimSize, netCDFDataType);

        // Loop over all granules
        for (GridCoverage2D gridCoverage: granuleStack.getGranules()) {
            final RenderedImage ri = gridCoverage.getRenderedImage();
View Full Code Here

            final DimensionValues dimensionValues = getDimensionValues();
            final Set<Object> values = (Set<Object>) dimensionValues.getValues();
            final int numElements = values.size();

            final String dimensionDataType = getCoverageDimension().getDatatype();
            final DataType netCDFDataType = NCUtilities.getNetCDFDataType(dimensionDataType);

            // Get a proper array to contain the dimension values
            final int[] dimensionSize = rangeValues ? new int[] { numElements, 2 } : new int[] {numElements};
            final Array data = NCUtilities.getArray(dimensionSize, netCDFDataType);
View Full Code Here

TOP

Related Classes of aQute.bnd.header.Attrs$DataType

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.