Package org.opengis.coverage

Examples of org.opengis.coverage.ColorInterpretation


        final ColorModel cm=image.getColorModel();
    final int numBands = sm.getNumBands();
    final GridSampleDimension[] bands = new GridSampleDimension[numBands];
    // setting bands names.
    for (int i = 0; i < numBands; i++) {
            final ColorInterpretation colorInterpretation=TypeMap.getColorInterpretation(cm, i);
            if(colorInterpretation==null)
                   throw new IOException("Unrecognized sample dimension type");
      bands[i] = new GridSampleDimension(colorInterpretation.name()).geophysics(true);
    }

        // creating coverage
        if (raster2Model != null) {
            return coverageFactory.create(coverageName, image, coverageCRS,
View Full Code Here


                            .create(noData, noData), NumberRange
                            .create(noData, noData));
                }
               
                for (int i = 0; i < numBands; i++) {
                        final ColorInterpretation colorInterpretation=TypeMap.getColorInterpretation(cm, i);
                        if(colorInterpretation==null)
                               throw new IOException("Unrecognized sample dimension type");
                        Category[] categories = null;
                        if (nan!=null){
                            categories = new Category[]{nan};
                        }
                            bands[i] = new GridSampleDimension(colorInterpretation.name(),categories,null).geophysics(true);
                }
                // creating coverage
                if (raster2Model != null) {
                        return coverageFactory.create(coverageName, image, crs,
                                        raster2Model, bands, null, null);
View Full Code Here

        final ColorModel cm=rgbImage.getColorModel();
    final int numBands = sm.getNumBands();
    final GridSampleDimension[] bands = new GridSampleDimension[numBands];
    // setting bands names.
    for (int i = 0; i < numBands; i++) {
            final ColorInterpretation colorInterpretation=TypeMap.getColorInterpretation(cm, i);
            if(colorInterpretation==null)
                   assertFalse("Unrecognized sample dimension type",true);
      bands[i] = new GridSampleDimension(colorInterpretation.name()).geophysics(true);
    }       
        final GridCoverage2D newCoverage=
          CoverageFactoryFinder.getGridCoverageFactory(null).create(
              "sample",
              rgbImage,
View Full Code Here

            properties.put("GC_NODATA", new Double(noData));
        }
       
        Set<String> bandNames = new HashSet<String>();
        for (int i = 0; i < numBands; i++) {
            final ColorInterpretation colorInterpretation = TypeMap.getColorInterpretation(cm, i);
            if (colorInterpretation == null) {
                throw new IOException("Unrecognized sample dimension type");
            }
            Category[] categories = null;
            if (noDataCategory != null) {
                categories = new Category[] { noDataCategory };
            }
                String bandName = colorInterpretation.name();
                // make sure we create no duplicate band names
                if(colorInterpretation == ColorInterpretation.UNDEFINED || bandNames.contains(bandName)) {
                    bandName = "Band" + (i + 1);
                }
                bands[i] = new GridSampleDimension(bandName,categories,null).geophysics(true);
View Full Code Here

        final int numBands = sm.getNumBands();
        final GridSampleDimension[] bands = new GridSampleDimension[numBands];
        // setting bands names.

        for (int i = 0; i < numBands; i++) {
            final ColorInterpretation colorInterpretation = TypeMap.getColorInterpretation(cm, i);
            if (colorInterpretation == null)
                throw new IOException("Unrecognized sample dimension type");
            Category[] categories = null;
            bands[i] = new GridSampleDimension(colorInterpretation.name(), categories, null).geophysics(true);
        }
        // creating coverage
        if (raster2Model != null) {
            return coverageFactory.create(coverageName, image, crs, raster2Model, bands, null, null);
        }
View Full Code Here

        final ColorModel cm = data.getColorModel();
        final int numBands = sm.getNumBands();
        final GridSampleDimension[] bands = new GridSampleDimension[numBands];
        // setting bands names.
        for (int i = 0; i < numBands; i++) {
            final ColorInterpretation colorInterpretation = TypeMap
                    .getColorInterpretation(cm, i);
            if (colorInterpretation == null)
                throw new IOException("Unrecognized sample dimension type");
            bands[i] = new GridSampleDimension(colorInterpretation.name())
                    .geophysics(true);
        }

        // creating the final coverage by keeping into account the fact that we
        // can just use the envelope, but we need to use the G2W
View Full Code Here

    final int numBands = sm.getNumBands();
    final GridSampleDimension[] bands = new GridSampleDimension[numBands];
    final Set<String> bandNames = new HashSet<String>();
    // setting bands names.
    for (int i = 0; i < numBands; i++) {
      ColorInterpretation colorInterpretation = null;
      String bandName = null;
      if (cm != null) {
        // === color interpretation
        colorInterpretation = TypeMap.getColorInterpretation(
            cm,
            i);
        if (colorInterpretation == null) {
          throw new IOException(
              "Unrecognized sample dimension type");
        }

        bandName = colorInterpretation.name();
        if ((colorInterpretation == ColorInterpretation.UNDEFINED) || bandNames.contains(bandName)) {// make
                                                        // sure
                                                        // we
                                                        // create
                                                        // no
View Full Code Here

TOP

Related Classes of org.opengis.coverage.ColorInterpretation

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.