本文整理了Java中it.geosolutions.jaiext.range.RangeFactory.create
方法的一些代码示例,展示了RangeFactory.create
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RangeFactory.create
方法的具体详情如下:
包路径:it.geosolutions.jaiext.range.RangeFactory
类名称:RangeFactory
方法名:create
暂无
代码示例来源:origin: geotools/geotools
private Range[] handleMosaicThresholds(double[][] thresholds, int srcNum) {
Range[] nodata = new Range[srcNum];
int minSrcNum = Math.min(srcNum, thresholds.length);
for (int i = 0; i < minSrcNum; i++) {
double maxValue = Double.NEGATIVE_INFINITY;
int numBands = thresholds[i].length;
for (int b = 0; b < numBands; b++) {
double bandValue = thresholds[i][b];
if (bandValue > maxValue) {
maxValue = bandValue;
}
}
nodata[i] = RangeFactory.create(Double.NEGATIVE_INFINITY, true, maxValue, false);
}
if (minSrcNum < srcNum) {
for (int i = minSrcNum; i < srcNum; i++) {
nodata[i] = nodata[0];
}
}
return nodata;
}
代码示例来源:origin: geotools/geotools
public Range extractNoDataProperty(final RenderedImage image) {
Object property = image.getProperty(NoDataContainer.GC_NODATA);
if (property != null) {
if (property instanceof NoDataContainer) {
return ((NoDataContainer) property).getAsRange();
} else if (property instanceof Double) {
return RangeFactory.create((Double) property, (Double) property);
}
}
return null;
}
代码示例来源:origin: geotools/geotools
/**
* Return a Piecewise transform doing clamping outside the central range
*
* @param minimum minimum valid value of the central range
* @param maximum maximum valid value of the central range
* @param minValue minValue to be returned from values outside (below) the central range
* @param maxValue maxValue to be returned from values outside (above) the central range
* @return
*/
private static PiecewiseTransform1D<DefaultPiecewiseTransform1DElement>
generateClampingPiecewise(
double minimum, double maximum, double minValue, double maxValue) {
final DefaultPiecewiseTransform1DElement zeroElement =
DefaultPiecewiseTransform1DElement.create(
"clamp-to-min", RangeFactory.create(0, true, minimum, false), minValue);
final DefaultPiecewiseTransform1DElement mainElement =
DefaultPiecewiseTransform1DElement.create(
"passthrough", RangeFactory.create(minimum, maximum));
final DefaultPiecewiseTransform1DElement maxElement =
DefaultPiecewiseTransform1DElement.create(
"clamp-to-max",
RangeFactory.create(maximum, false, Double.POSITIVE_INFINITY, true),
maxValue);
return new DefaultPiecewiseTransform1D<DefaultPiecewiseTransform1DElement>(
new DefaultPiecewiseTransform1DElement[] {zeroElement, mainElement, maxElement}, 0);
}
代码示例来源:origin: geotools/geotools
DefaultPiecewiseTransform1DElement.create(
"exponential-contrast-enhancement-transform",
RangeFactory.create(minimum, maximum),
new MathTransformationAdapter() {
代码示例来源:origin: geotools/geotools
DefaultPiecewiseTransform1DElement.create(
"gamma-correction-transform",
RangeFactory.create(minimum, maximum),
new MathTransformationAdapter() {
代码示例来源:origin: geotools/geotools
DefaultPiecewiseTransform1DElement.create(
"logarithmic-contrast-enhancement-transform",
RangeFactory.create(minimum, maximum),
new MathTransformationAdapter() {
代码示例来源:origin: geotools/geotools
"ColorMapEntry" + this.colormapElements.size(),
lastColorValue,
RangeFactory.create(
previous.getRange().getMax().doubleValue(),
true,
+ Integer.toString(i + 1),
preservedValuesColor,
RangeFactory.create(preservedValues.get(i), preservedValues.get(i)),
value);
代码示例来源:origin: geotools/geotools
private void prepareAlgebricOperation(
Operator op, ParameterBlock pb, ROI roi, Range nodata, boolean setDestNoData) {
pb.set(op, 0);
pb.set(roi, 1);
pb.set(nodata, 2);
if (background != null && background.length > 0) {
pb.set(background[0], 3);
// We must set the new NoData value
if (setDestNoData && roi != null && nodata != null) {
setNoData(RangeFactory.create(background[0], background[0]));
}
}
}
代码示例来源:origin: geotools/geotools
/**
* Method for creating the nodata range associated to each coverage
*
* @param cov
* @param dataType
* @return
*/
private Range createNoDataRange(GridCoverage2D cov, int dataType) {
// Extract NoData property from gridCoverage
NoDataContainer container = CoverageUtilities.getNoDataProperty(cov);
if (container != null) {
return container.getAsRange();
}
// No property set, use the input NoData Range
double[] nodatas = CoverageUtilities.getBackgroundValues(cov);
if (nodatas != null && nodatas.length > 0) {
Range noData =
RangeFactory.convert(RangeFactory.create(nodatas[0], nodatas[0]), dataType);
return noData;
}
return null;
}
代码示例来源:origin: geotools/geotools
it.geosolutions.jaiext.range.Range rangeJaiext =
RangeFactory.convert(
RangeFactory.create(
range.getMin().doubleValue(),
range.isMinIncluded(),
it.geosolutions.jaiext.range.Range rangeJaiext =
RangeFactory.convert(
RangeFactory.create(
getClassMinimum(widestClass).doubleValue(),
getClassMaximum(widestClass).doubleValue()),
代码示例来源:origin: geotools/geotools
private void prepareOpConstOperation(
Operator op,
double[] values,
ParameterBlock pb,
ROI roi,
Range nodata,
boolean setDestNoData) {
pb.set(op, 1);
pb.set(values, 0);
pb.set(roi, 2);
pb.set(nodata, 3);
if (background != null && background.length > 0) {
pb.set(background[0], 4);
// We must set the new NoData value
if (setDestNoData && roi != null && nodata != null) {
setNoData(RangeFactory.create(background[0], background[0]));
}
}
}
代码示例来源:origin: geotools/geotools
"c0",
Color.yellow,
RangeFactory.create(Double.NEGATIVE_INFINITY, false, 1100, true),
5);
"c2", Color.blue, RangeFactory.create(1100.0, false, 1200.0, true), 1);
"c3", Color.green, RangeFactory.create(1200.0, false, 1400.0, true), 7);
"c4", Color.blue, RangeFactory.create(1400.0, false, 1600, true), 1);
"c4",
Color.CYAN,
RangeFactory.create(1600.0, false, Double.POSITIVE_INFINITY, true),
11);
"nodata",
new Color(0, 0, 0, 0),
RangeFactory.create(Double.NaN, Double.NaN),
0);
代码示例来源:origin: geotools/geotools
"zero", RangeFactory.create(0, 100), RangeFactory.create(0, 200));
Assert.assertTrue(e0 instanceof DefaultLinearPiecewiseTransform1DElement);
代码示例来源:origin: geotools/geotools
/** Apply a rangeLookup operation on the underlying image. */
public ImageWorker rangeLookup(Object rangeLookup) {
// ParameterBlock definition
ParameterBlock pb = new ParameterBlock();
pb.setSource(image, 0);
pb.set(rangeLookup, 0);
pb.set(roi, 2);
if (roi != null) {
if (background != null && background.length > 0) {
pb.set(background[0], 1);
// We must set the new NoData value
setNoData(RangeFactory.create(background[0], background[0]));
}
}
if (JAIExt.isJAIExtOperation("RLookup")) {
image = JAI.create("RLookup", pb, getRenderingHints());
} else {
image = JAI.create("RangeLookup", pb, getRenderingHints());
}
return this;
}
代码示例来源:origin: geotools/geotools
"c1", RangeFactory.create(1, 128), RangeFactory.create(1, 255));
final DefaultPiecewiseTransform1DElement c0 =
DefaultLinearPiecewiseTransform1DElement.create(
"c0", RangeFactory.create(129, 255), RangeFactory.create(255, 255));
final DefaultPiecewiseTransform1DElement nodata =
DefaultLinearPiecewiseTransform1DElement.create(
"nodata", RangeFactory.create(0, 0), 0);
final DefaultPiecewiseTransform1D<DefaultPiecewiseTransform1DElement> list =
new DefaultPiecewiseTransform1D<DefaultPiecewiseTransform1DElement>(
代码示例来源:origin: geotools/geotools
/** Apply a Generic Piecewise operation on the underlying image. */
public ImageWorker piecewise(PiecewiseTransform1D transform, Integer bandIndex) {
ParameterBlock pb = new ParameterBlock();
pb.setSource(image, 0); // The source image.
pb.set(transform, 0);
pb.set(bandIndex, 1);
pb.set(roi, 2);
pb.set(nodata, 3);
if (isNoDataNeeded()) {
if (transform.hasGaps()) {
// We must set the new NoData value
setNoData(
RangeFactory.create(
transform.getDefaultValue(), transform.getDefaultValue()));
}
}
image = JAI.create("GenericPiecewise", pb, getRenderingHints());
return this;
}
代码示例来源:origin: geotools/geotools
setNoData(RangeFactory.create((byte) destNodata, DataBuffer.TYPE_BYTE));
代码示例来源:origin: geotools/geotools
/** Apply a Raster classification on the underlying image. */
public ImageWorker classify(ColorMapTransform domain1D, Integer bandIndex) {
ParameterBlock pb = new ParameterBlock();
pb.setSource(image, 0); // The source image.
pb.set(domain1D, 0);
pb.set(bandIndex, 1);
pb.set(roi, 2);
pb.set(nodata, 3);
if (isNoDataNeeded()) {
if (domain1D.hasGaps()) {
// We must set the new NoData value
setNoData(
RangeFactory.create(
domain1D.getDefaultValue(), domain1D.getDefaultValue()));
}
}
image = JAI.create("RasterClassifier", pb, getRenderingHints());
return this;
}
代码示例来源:origin: geotools/geotools
"nodata",
new Color(0, 0, 0, 0),
RangeFactory.create(Double.NaN, Double.NaN),
9999);
代码示例来源:origin: geotools/geotools
"p0", RangeFactory.create(0.0, true, 1.0, true));
Assert.assertEquals(p0.getTargetDimensions(), 1);
Assert.assertEquals(p0.getSourceDimensions(), 1);
内容来源于网络,如有侵权,请联系作者删除!