Package org.geotools.coverage

Examples of org.geotools.coverage.GridSampleDimension


    // 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);
    }

        return coverageFactory.create(rasterManager.getCoverageIdentifier(), image,new GeneralEnvelope(bbox), bands, null, null);   

  }
View Full Code Here


    @Test
    public void testTypes() {
        // Creation of a default field type
        Set<SampleDimension> sampleDims = new HashSet<SampleDimension>();
        GridSampleDimension sampleDim = new GridSampleDimension("test");
        sampleDims.add(sampleDim);
        NameImpl name = new NameImpl("test");
        SimpleInternationalString description = new SimpleInternationalString("test");
        FieldType fieldType = new DefaultFieldType(name, description, sampleDims);
       
View Full Code Here

    final int numBands = image.getSampleModel().getNumBands();
    final GridSampleDimension[] bands = new GridSampleDimension[numBands];
    // setting bands names.
    for (int i = 0; i < numBands; i++) {

      bands[i] = new GridSampleDimension("band " + i);
    }
    final String filename = new File(path).getName();
    final GridCoverageFactory factory = org.geotools.coverage.CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());
    envelope.setCoordinateReferenceSystem(crs);
    return factory.create(filename, image, envelope,bands, null, null);
View Full Code Here

        // range = imageReader.getRasterReader().getRange();

        /*
         * create the categories from the color rules
         */
        GridSampleDimension band = createGridSampleDimension(metaDataTable, range);
        band = band.geophysics(true);

        // create a relationship between the real region in the world and the
        // jai space. N.B. the
        // image dimension is only the real dimension which can be extract to a
        // file.
View Full Code Here

                catsList.add(dataCategory);
            }

            Category[] array = (Category[]) catsList.toArray(new Category[catsList.size()]);
            return new GridSampleDimension(name, array, null);
        } else {
            return new GridSampleDimension(name, new Category[]{}, null);
        }
    }
View Full Code Here

                final ColorInterpretation colorInterpretation;
                colorInterpretation = TypeMap.getColorInterpretation(cm, i);
                if (colorInterpretation == null) {
                    throw new IOException("Unrecognized sample dimension type");
                }
                bands[i] = new GridSampleDimension(colorInterpretation.name()).geophysics(true);
            }
        }

        return bands;
    }
View Full Code Here

      assertEquals(1, bkg.length);
      assertEquals(Double.valueOf(-9999.0), bkg[0]);
     
      // test grid sampledimension no data property
      final Category noDataCategory= new Category(CoverageUtilities.NODATA,new Color[]{Color.black},NumberRange.create(Double.valueOf(-9999.0),Double.valueOf(-9999.0)),NumberRange.create(Double.valueOf(-9999.0),Double.valueOf(-9999.0)));
      final GridSampleDimension gsd = new GridSampleDimension("test", new Category[]{noDataCategory},Unit.ONE);
      gc= CoverageFactoryFinder.getGridCoverageFactory(null).
      create(
          "test",
          ImageFunctionDescriptor.create(new MyImageFunction(), Integer.valueOf(800), Integer.valueOf(600), Float.valueOf(1.0f),  Float.valueOf(1.0f),  Float.valueOf(0.0f),  Float.valueOf(0.0f), null),
          gg2D,
View Full Code Here

                    }
                    final Name nameImpl = new NameImpl(coverageName.getLocalPart(), elementName);
                    final InternationalString description = new SimpleInternationalString(product!=null?product.getDescription():elementName);

                    // setting bands names.
                    final GridSampleDimension gridBand = Utilities.buildBands(band, elementName, unit);
                    final HDF4ProductFieldType fd = new HDF4ProductFieldType(nameImpl, description, gridBand);
                    fields.put(elementName, fd);
                }

                // //
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, coverageCRS,
View Full Code Here

                               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

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.