gpt4 book ai didi

org.geotools.geometry.util.XRectangle2D.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 14:37:05 41 4
gpt4 key购买 nike

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

XRectangle2D.<init>介绍

[英]Construct a default rectangle. Initial coordinates are (0,0,0,0).
[中]构造一个默认矩形。初始坐标为(0,0,0,0)。

代码示例

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

/**
 * Create a rectangle using maximal <var>x</var> and <var>y</var> values rather than width and
 * height. This factory avoid the problem of NaN values when extremums are infinite numbers.
 */
public static XRectangle2D createFromExtremums(
    final double xmin, final double ymin, final double xmax, final double ymax) {
  final XRectangle2D rect = new XRectangle2D();
  rect.xmin = xmin;
  rect.ymin = ymin;
  rect.xmax = xmax;
  rect.ymax = ymax;
  return rect;
}

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

/**
 * Returns a new {@code Rectangle2D} object representing the intersection of this {@code
 * Rectangle2D} with the specified {@code Rectangle2D}.
 *
 * @param rect the {@code Rectangle2D} to be intersected with this {@code Rectangle2D}
 * @return the largest {@code Rectangle2D} contained in both the specified {@code Rectangle2D}
 *     and in this {@code Rectangle2D}.
 */
public Rectangle2D createIntersection(final Rectangle2D rect) {
  final XRectangle2D r = new XRectangle2D();
  r.xmin = Math.max(xmin, rect.getMinX());
  r.ymin = Math.max(ymin, rect.getMinY());
  r.xmax = Math.min(xmax, rect.getMaxX());
  r.ymax = Math.min(ymax, rect.getMaxY());
  return r;
}

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

/**
 * Returns a new {@code Rectangle2D} object representing the union of this {@code Rectangle2D}
 * with the specified {@code Rectangle2D}.
 *
 * @param rect the {@code Rectangle2D} to be combined with this {@code Rectangle2D}
 * @return the smallest {@code Rectangle2D} containing both the specified {@code Rectangle2D}
 *     and this {@code Rectangle2D}.
 */
public Rectangle2D createUnion(final Rectangle2D rect) {
  final XRectangle2D r = new XRectangle2D();
  r.xmin = Math.min(xmin, rect.getMinX());
  r.ymin = Math.min(ymin, rect.getMinY());
  r.xmax = Math.max(xmax, rect.getMaxX());
  r.ymax = Math.max(ymax, rect.getMaxY());
  return r;
}

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

new XRectangle2D(
    raster.getMinX() + 0.5,
    raster.getMinY() + 0.5,

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com