/** * Constructs a new sample dimension with the same categories and * units than the specified sample dimension. * * @param other The other sample dimension, or {@code null}. */ protected GridSampleDimension(final GridSampleDimension other) { if (other != null) { inverse = other.inverse; categories = other.categories; isGeophysics = other.isGeophysics; hasQualitative = other.hasQualitative; hasQuantitative = other.hasQuantitative; sampleToGeophysics = other.sampleToGeophysics; description = other.description; } else { // 'inverse' will be set when needed. categories = null; isGeophysics = false; hasQualitative = false; hasQuantitative = false; sampleToGeophysics = null; description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED); } }
/** * Constructs a new sample dimension with the same categories and * units than the specified sample dimension. * * @param other The other sample dimension, or {@code null}. */ protected GridSampleDimension(final GridSampleDimension other) { if (other != null) { inverse = other.inverse; categories = other.categories; isGeophysics = other.isGeophysics; hasQualitative = other.hasQualitative; hasQuantitative = other.hasQuantitative; sampleToGeophysics = other.sampleToGeophysics; description = other.description; } else { // 'inverse' will be set when needed. categories = null; isGeophysics = false; hasQualitative = false; hasQuantitative = false; sampleToGeophysics = null; description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED); } }
protected GridCoverage2D createGridCoverage(CharSequence name, RenderedImage image, GridSampleDimension[] bands, double noDataValue, double minValue, double maxValue, ReferencedEnvelope extent) { if (image == null || extent == null) { throw new NullPointerException("WritableRaster is null!"); } if (noDataValue == minValue) { noDataValue = minValue - 1; } else if (noDataValue == maxValue) { noDataValue = maxValue + 1; } else if (noDataValue > minValue && noDataValue < maxValue) { noDataValue = minValue - 1; } CharSequence noDataName = Vocabulary.formatInternational(VocabularyKeys.NODATA); // setting metadata final Map<CharSequence, Double> properties = new HashMap<CharSequence, Double>(); properties.put("Maximum", Double.valueOf(maxValue)); properties.put("Minimum", Double.valueOf(minValue)); // properties.put("Mean", 1.0); // properties.put("StdDev", 1.0); properties.put(noDataName, Double.valueOf(noDataValue)); properties.put("GC_NODATA", Double.valueOf(noDataValue)); GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null); return factory.create(name, image, extent, bands, null, properties); }
/** * Creates a {@link CartesianCS} for a {@link ProjectedCRS} given the * provided {@link Unit}. * * @todo consider caching this items * @param linearUnit * to be used for building this {@link CartesianCS}. * @return an instance of {@link CartesianCS} using the provided * {@link Unit}, */ private DefaultCartesianCS createProjectedCS(Unit linearUnit) { if (linearUnit == null) throw new NullPointerException( "Error when trying to create a PCS using this linear UoM "); if (!linearUnit.isCompatible(SI.METER)) throw new IllegalArgumentException( "Error when trying to create a PCS using this linear UoM " + linearUnit.toString()); return new DefaultCartesianCS(Vocabulary.formatInternational( VocabularyKeys.PROJECTED).toString(), new DefaultCoordinateSystemAxis(Vocabulary .formatInternational(VocabularyKeys.EASTING), "E", AxisDirection.EAST, linearUnit), new DefaultCoordinateSystemAxis(Vocabulary .formatInternational(VocabularyKeys.NORTHING), "N", AxisDirection.NORTH, linearUnit)); }
Vocabulary.formatInternational(VocabularyKeys.NORMAL), (Color) null, NumberRange.create(minimum, maximum)),} ? new Category[] { new Category( Vocabulary.formatInternational(VocabularyKeys.NODATA), new Color(0, 0, 0, 0), NumberRange.create(nodata, nodata))}
public SimplifiedGridSampleDimension( CharSequence description, SampleDimensionType type, ColorInterpretation color, double nodata, double minimum, double maximum, double scale, double offset, Unit<?> unit) { super(description,!Double.isNaN(nodata)? new Category[]{new Category(Vocabulary .formatInternational(VocabularyKeys.NODATA), new Color[]{new Color(0, 0, 0, 0)} , NumberRange .create(nodata, nodata), NumberRange .create(nodata, nodata))}:null,unit); this.nodata=nodata; this.minimum=minimum; this.maximum=maximum; this.scale=scale; this.offset=offset; this.unit=unit; this.type=type; this.color=color; this.bkg=new Category("Background", Utils.TRANSPARENT, 0); }
CharSequence noDataName = Vocabulary.formatInternational(VocabularyKeys.NODATA); Category nan = new Category(noDataName, new Color[] { new Color(255, 255, 255, 0) }, NumberRange.create(noDataValue, noDataValue));
CharSequence noDataName = Vocabulary.formatInternational(VocabularyKeys.NODATA);
if (!Double.isNaN(noData)){ noDataCategory = new Category(Vocabulary .formatInternational(VocabularyKeys.NODATA), new Color[] { new Color(0, 0, 0, 0) }, NumberRange .create(noData, noData), NumberRange .create(noData, noData));
InternationalString noDataName = Vocabulary.formatInternational(VocabularyKeys.NODATA); Object objNoData = srcCoverage.getProperty(noDataName.toString()); if (objNoData != null && objNoData instanceof Number) {
if (Double.isNaN(inNoData)) { nan = new Category(Vocabulary .formatInternational(VocabularyKeys.NODATA), new Color( 0, 0, 0, 0), 0); .formatInternational(VocabularyKeys.NODATA), new Color[] { new Color(0, 0, 0, 0) }, NumberRange.create(0, 0),
this.description = list.getName(); } else { this.description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED);
this.description = list.getName(); } else { this.description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED);
if (Double.isNaN(inNoData)) { nan = new Category(Vocabulary .formatInternational(VocabularyKeys.NODATA), new Color( 0, 0, 0, 0), 0); values = new Category("values", demColors, new NumberRange(1, .formatInternational(VocabularyKeys.NODATA), new Color[] { new Color(0, 0, 0, 0) }, new NumberRange( 0, 0), new NumberRange(inNoData, inNoData));
Vocabulary.formatInternational(VocabularyKeys.NODATA), transparent, noDataValue); categories = new Category[] { valuesCat, nodataCat };
properties.put(Vocabulary.formatInternational(VocabularyKeys.NODATA), noData); properties.put("GC_NODATA", noData);
properties.put(Vocabulary.formatInternational(VocabularyKeys.NODATA), noData); properties.put("GC_NODATA", noData);
properties.put(Vocabulary.formatInternational(VocabularyKeys.NODATA), noData); properties.put("GC_NODATA", noData);
properties.put(Vocabulary.formatInternational(VocabularyKeys.NODATA), noData); properties.put("GC_NODATA", noData);
properties.put(Vocabulary.formatInternational(VocabularyKeys.NODATA), noData); properties.put("GC_NODATA", noData);