Package org.geotools.coverage

Examples of org.geotools.coverage.GridSampleDimension


                    || bandNames.contains(colorInterpretation.name())) {
                bandName = "Band" + (i + 1);
            else {
                bandName = colorInterpretation.name();
            }
            bands[i] = new GridSampleDimension(bandName).geophysics(true);
        }

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


        }       
        // recreate gridCoverage
        int numBands = im.getSampleModel().getNumBands();
        GridSampleDimension[] sd = new GridSampleDimension[numBands];
        for(int i=0;i<numBands;i++) {
            sd[i]= new GridSampleDimension(TypeMap.getColorInterpretation(im.getColorModel(), i).name());
        }
       
        // create a new grid coverage but preserve as much input as possible
       return this.gridCoverageFactory.create(
               input.getName(),
View Full Code Here

    // short?
    if (DataBuffer.TYPE_SHORT == origDataType) {
      return image;
    }

    final GridSampleDimension visibleSD = ((GridSampleDimension) gc2D
        .getSampleDimension(0)).geophysics(true);

    // getting categories
    final List oldCategories = visibleSD.getCategories();

    // removing old nodata category
    // candidate
    Category candidate = null;
    NumberRange candidateRange = null;
View Full Code Here

        // 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,
                    getCoordinateReferenceSystem(coverageName), raster2Model, bands, null, null);
View Full Code Here

            this.band = band;
           
            // prepare the classification image if necessary
            if(classification != null) {
                // find nodata values
                GridSampleDimension sampleDimension = classification.getSampleDimension(0);
                double[] nodataarr = sampleDimension.getNoDataValues();
                double nodata = nodataarr != null? nodataarr[0] : Double.NaN;
   
                // this will adapt the classification image to the projection and image layout
                // of the data coverage
                classificationRaster = GridCoverage2DRIA.create(classification, dataCoverage, nodata);
View Full Code Here

                    geometryEnvelope = new ReferencedEnvelope(geometry.getEnvelopeInternal(),
                            dataCoverage.getCoordinateReferenceSystem());
                }

                // check if the novalue is != from NaN
                GridSampleDimension sampleDimension = dataCoverage.getSampleDimension(0);
                List<Category> categories = sampleDimension.getCategories();
                List<Range<Double>> novalueRangeList = null;
                if (categories != null) {
                    for (Category category : categories) {
                        String catName = category.getName().toString();
                        if (catName.equalsIgnoreCase("no data")) {
View Full Code Here

            return null;
        }
        // Get the names of the bands
        String[] sampleDimensionNames = new String[numBands];
        for (int i = 0; i < numBands; i++) {
            GridSampleDimension dim = cov.getSampleDimension(i);
            sampleDimensionNames[i] = dim.getDescription().toString();
        }
        final int RED = 0, GREEN = 1, BLUE = 2;
        int[] channelNum = { -1, -1, -1 };
        // We examine the band names looking for "red...", "green...", "blue...".
        // Note that the channel numbers we record are indexed from 1, not 0.
View Full Code Here

        // build the output coverage
        //
       
       
        // build the output sample dimensions, use the default value ( 0 ) as the no data
        final GridSampleDimension outSampleDimension = new GridSampleDimension("classification",
                new Category[] { Category.NODATA }, null).geophysics(true);
        final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());
        final GridCoverage2D output = factory.create("reclassified", indexedClassification, coverage
                .getGridGeometry(), new GridSampleDimension[] { outSampleDimension },
                new GridCoverage[] { coverage }, new HashMap<String,Double>(){{
View Full Code Here

                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);
        }
        // creating coverage
        if (raster2Model != null) {
                return coverageFactory.create(coverageName, image, crs,raster2Model, bands, null, properties);
        }
View Full Code Here

       
        // range type
        String description = variableDS.getDescription();
        final StringBuilder sb = new StringBuilder();
        final Set<SampleDimension> sampleDims = new HashSet<SampleDimension>();
        sampleDims.add(new GridSampleDimension(description + ":sd", (Category[]) null, null));

        InternationalString desc = null;
        if (description != null && !description.isEmpty()) {
            desc = new SimpleInternationalString(description);
        }
View Full Code Here

TOP

Related Classes of org.geotools.coverage.GridSampleDimension

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.