Examples of PAMRasterBand


Examples of it.geosolutions.imageio.pam.PAMDataset.PAMRasterBand

        GridCoverage2D coverage = reader.read(new GeneralParameterValue[]{time});
        Object object = coverage.getProperty(Utils.PAM_DATASET);
        assertNotNull(object);
        assertTrue(object instanceof PAMDataset);
        PAMDataset dataset = (PAMDataset) object;
        PAMRasterBand band = dataset.getPAMRasterBand().get(0);

        PAMParser parser = PAMParser.getInstance();
        assertEquals(0, Double.parseDouble(parser.getMetadataValue(band, "STATISTICS_MINIMUM")), DELTA);
        assertEquals(255.0, Double.parseDouble(parser.getMetadataValue(band, "STATISTICS_MAXIMUM")), DELTA);
        assertEquals(73.0352, Double.parseDouble(parser.getMetadataValue(band, "STATISTICS_MEAN")), DELTA);
View Full Code Here

Examples of it.geosolutions.imageio.pam.PAMDataset.PAMRasterBand

        GridCoverage2D coverage = reader.read(null);
        Object object = coverage.getProperty(Utils.PAM_DATASET);
        assertNotNull(object);
        assertTrue(object instanceof PAMDataset);
        PAMDataset dataset = (PAMDataset) object;
        PAMRasterBand band = dataset.getPAMRasterBand().get(0);

        PAMParser parser = PAMParser.getInstance();
        assertEquals(0, Double.parseDouble(parser.getMetadataValue(band, "STATISTICS_MINIMUM")), DELTA);
        assertEquals(255.0, Double.parseDouble(parser.getMetadataValue(band, "STATISTICS_MAXIMUM")), DELTA);
        assertEquals(72.6912, Double.parseDouble(parser.getMetadataValue(band, "STATISTICS_MEAN")), DELTA);
View Full Code Here

Examples of it.geosolutions.imageio.pam.PAMDataset.PAMRasterBand

        if (samplePam != null) {
            merged = new PAMDataset();
            final List<PAMRasterBand> samplePamRasterBands = samplePam.getPAMRasterBand();
            final int numBands = samplePamRasterBands.size();
            List<PAMRasterBand> pamRasterBands = merged.getPAMRasterBand();
            PAMRasterBand sampleBand = samplePamRasterBands.get(0);
            List<MDI> sampleMetadata = sampleBand.getMetadata().getMDI();
            for (int i = 0; i<numBands; i++) {
                final PAMRasterBand band = new PAMRasterBand();
                final Metadata metadata = new Metadata();
                List<MDI> mdiList = metadata.getMDI();
                for (MDI mdi: sampleMetadata) {
                    MDI addedMdi = new MDI();
                    addedMdi.setKey(mdi.getKey());
                    mdiList.add(addedMdi);
                }
                band.setMetadata(metadata);
                pamRasterBands.add(band);
            }
        }
        return merged;
    }
View Full Code Here

Examples of it.geosolutions.imageio.pam.PAMDataset.PAMRasterBand

        Utilities.ensureNonNull("coverage", coverage);
        final Object prop = coverage.getProperty(Utils.PAM_DATASET);
        if (prop != null && prop instanceof PAMDataset) {
            final PAMDataset dataset = (PAMDataset) prop;
            // Need to play with channel selection to deal with different raster bands
            final PAMRasterBand band = dataset.getPAMRasterBand().get(0);
            if (band != null) {
                final String value = pamParser.getMetadataValue(band, "STATISTICS_"+ statName.toUpperCase());
                return Double.parseDouble(value);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.