it.geosolutions.jaiext.range.Range.getMax()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中it.geosolutions.jaiext.range.Range.getMax方法的一些代码示例,展示了Range.getMax的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.getMax方法的具体详情如下:
包路径:it.geosolutions.jaiext.range.Range
类名称:Range
方法名:getMax

Range.getMax介绍

[英]Returns the maximum bound of the Range
[中]返回范围的最大界限

代码示例

代码示例来源:origin: geotools/geotools

lastColorValue,
        RangeFactory.create(
            previous.getRange().getMax().doubleValue(),
            true,
            Double.POSITIVE_INFINITY,
            false),
        previous.getOutputRange().getMax().intValue());
this.colormapElements.add(last);

代码示例来源:origin: geotools/geotools

double previousMax = ((Range) previous.getRange()).getMax().doubleValue();
Color[] previousColors = previous.getColors();
if (PiecewiseUtilities.compare(previousMax, q) != 0) {
    case ColorMap.TYPE_RAMP:
      Color[] colors = new Color[] {lastColorValue, newColorValue};
      int previousMaximum = (int) previous.getOutputRange().getMax().intValue();

代码示例来源:origin: geotools/geotools

if (background == null && nodProp != null && nodataBackground == null) {
  nodataBackground = new double[1];
  nodataBackground[0] = nodProp.getMax().doubleValue();

代码示例来源:origin: geotools/geotools

Assert.assertEquals(piecewise.getApproximateDomainRange().getMax().doubleValue(), 1.0, 0.0);
Assert.assertEquals(piecewise.transform(0.5), 0.5, 0.0);
Assert.assertEquals(

代码示例来源:origin: stackoverflow.com

public void clauseMinMax(String format, Range r) {
 if (r != null) {
   builder.clause(String.format(format, r.getMin(), r.getMax()));
 }
}

代码示例来源:origin: geotools/geotools

Assert.assertEquals(transform.getName().toString(), t1.getName().toString());
Assert.assertEquals(transform.getApproximateDomainRange().getMin().doubleValue(), 1.0, 0.0);
Assert.assertEquals(transform.getApproximateDomainRange().getMax().doubleValue(), 2.0, 0.0);
Assert.assertEquals(transform.transform(1.5), 201, 0.0);
Assert.assertEquals(

代码示例来源:origin: it.geosolutions.jaiext.utilities/jt-utilities

public static Range convertToByteRange(Range input) {
  // If already double do nothing
  if (input instanceof RangeByte) {
    return input;
  }
  // Otherwise get minimum and maximum values and convert it
  byte min = input.getMin().byteValue();
  byte max = input.getMax().byteValue();
  boolean minIncluded = input.isMinIncluded();
  boolean maxIncluded = input.isMaxIncluded();
  // New Double range
  return new RangeByte(min, minIncluded, max, maxIncluded);
}

代码示例来源:origin: it.geosolutions.jaiext.utilities/jt-utilities

@Override
public int hashCode() {
  int result = 37;
    result += getDataType().getClass().hashCode();
    result = hash(isMaxIncluded, result);
    result = hash(isMinIncluded, result);
    result = hash(getMax().doubleValue(), result);
    result = hash(getMin().doubleValue(), result);
  return result;
}

代码示例来源:origin: geosolutions-it/jai-ext

@Override
public int hashCode() {
  int result = 37;
    result += getDataType().getClass().hashCode();
    result = hash(isMaxIncluded, result);
    result = hash(isMinIncluded, result);
    result = hash(getMax().doubleValue(), result);
    result = hash(getMin().doubleValue(), result);
  return result;
}

代码示例来源:origin: geosolutions-it/jai-ext

public static Range convertToByteRange(Range input) {
  // If already double do nothing
  if (input instanceof RangeByte) {
    return input;
  }
  // Otherwise get minimum and maximum values and convert it
  byte min = input.getMin().byteValue();
  byte max = input.getMax().byteValue();
  boolean minIncluded = input.isMinIncluded();
  boolean maxIncluded = input.isMaxIncluded();
  // New Double range
  return new RangeByte(min, minIncluded, max, maxIncluded);
}

代码示例来源:origin: it.geosolutions.jaiext.utilities/jt-utilities

public boolean intersects(Range other) {
  // Check if one of them is contained into the other
  if (this.contains(other) || other.contains(this)) {
    return true;
  }
  double min1 = this.getMin().doubleValue();
  double max1 = this.getMax().doubleValue();
  double min2 = other.getMin().doubleValue();
  double max2 = other.getMax().doubleValue();
  // Check the bounds
  boolean minCheck = this.isMinIncluded() && other.isMaxIncluded() ? min1 <= max2
      : min1 < max2;
  boolean maxCheck = this.isMaxIncluded() && other.isMinIncluded() ? max1 >= min2
      : max1 > min2;
  return minCheck && maxCheck;
}

代码示例来源:origin: geosolutions-it/jai-ext

public boolean intersects(Range other) {
  // Check if one of them is contained into the other
  if (this.contains(other) || other.contains(this)) {
    return true;
  }
  double min1 = this.getMin().doubleValue();
  double max1 = this.getMax().doubleValue();
  double min2 = other.getMin().doubleValue();
  double max2 = other.getMax().doubleValue();
  // Check the bounds
  boolean minCheck = this.isMinIncluded() && other.isMaxIncluded() ? min1 <= max2
      : min1 < max2;
  boolean maxCheck = this.isMaxIncluded() && other.isMinIncluded() ? max1 >= min2
      : max1 > min2;
  return minCheck && maxCheck;
}

代码示例来源:origin: it.geosolutions.jaiext.utilities/jt-utilities

public static Range convertToFloatRange(Range input) {
  // If already double do nothing
  if (input instanceof RangeFloat) {
    return input;
  }
  // Otherwise get minimum and maximum values and convert it
  float min = input.getMin().floatValue();
  float max = input.getMax().floatValue();
  boolean minIncluded = input.isMinIncluded();
  boolean maxIncluded = input.isMaxIncluded();
  boolean nanIncluded = input.isNanIncluded();
  // New Double range
  return new RangeFloat(min, minIncluded, max, maxIncluded, nanIncluded);
}

代码示例来源:origin: geosolutions-it/jai-ext

public static Range convertToDoubleRange(Range input) {
  // If already double do nothing
  if (input instanceof RangeDouble) {
    return input;
  }
  // Otherwise get minimum and maximum values and convert it
  double min = input.getMin().doubleValue();
  double max = input.getMax().doubleValue();
  boolean minIncluded = input.isMinIncluded();
  boolean maxIncluded = input.isMaxIncluded();
  boolean nanIncluded = input.isNanIncluded();
  // New Double range
  return new RangeDouble(min, minIncluded, max, maxIncluded, nanIncluded);
}

代码示例来源:origin: it.geosolutions.jaiext.utilities/jt-utilities

public static Range convertToDoubleRange(Range input) {
  // If already double do nothing
  if (input instanceof RangeDouble) {
    return input;
  }
  // Otherwise get minimum and maximum values and convert it
  double min = input.getMin().doubleValue();
  double max = input.getMax().doubleValue();
  boolean minIncluded = input.isMinIncluded();
  boolean maxIncluded = input.isMaxIncluded();
  boolean nanIncluded = input.isNanIncluded();
  // New Double range
  return new RangeDouble(min, minIncluded, max, maxIncluded, nanIncluded);
}

代码示例来源:origin: geosolutions-it/jai-ext

public static Range convertToFloatRange(Range input) {
  // If already double do nothing
  if (input instanceof RangeFloat) {
    return input;
  }
  // Otherwise get minimum and maximum values and convert it
  float min = input.getMin().floatValue();
  float max = input.getMax().floatValue();
  boolean minIncluded = input.isMinIncluded();
  boolean maxIncluded = input.isMaxIncluded();
  boolean nanIncluded = input.isNanIncluded();
  // New Double range
  return new RangeFloat(min, minIncluded, max, maxIncluded, nanIncluded);
}

代码示例来源:origin: geotools/geotools

if (nodata.getMax().doubleValue() != Double.POSITIVE_INFINITY) {
  builder.add(
      RangeFactory.create(
          nodata.getMax().doubleValue(),
          !nodata.isMaxIncluded(),
          Double.POSITIVE_INFINITY,

代码示例来源:origin: geosolutions-it/jai-ext

@Test
public void testConvertFloatNaN() {
  Range nanDouble = RangeFactory.create(Double.NaN, Double.NaN);
  Range nanFloat = RangeFactory.convert(nanDouble, DataBuffer.TYPE_FLOAT);
  assertEquals(Float.NaN, nanFloat.getMin());
  assertEquals(Float.NaN, nanFloat.getMax());
}

代码示例来源:origin: geosolutions-it/jai-ext

@Test
  public void testConvertDoubleNaN() {
    Range nanFloat = RangeFactory.create(Float.NaN, Float.NaN);
    Range nanDouble = RangeFactory.convert(nanFloat, DataBuffer.TYPE_DOUBLE);
    assertEquals(Double.NaN, nanDouble.getMin());
    assertEquals(Double.NaN, nanDouble.getMax());
  }
}

代码示例来源:origin: geosolutions-it/jai-ext

private void checkRangeConversion(Range range, int targetType) {
  Range converted = RangeFactory.convert(range, targetType);
  assertEquals(converted.getMin().intValue(), 255);
  assertEquals(converted.getMax().intValue(), 255);
  assertTrue(converted.isMinIncluded);
  assertTrue(converted.isMaxIncluded);
  assertEquals(targetType, converted.getDataType().getDataType());
  if (range.getDataType().getDataType() == targetType) {
    assertSame(range, converted);
  } else {
    assertNotSame(range, converted);
  }
}

相关文章