com.esri.core.geometry.Point.equals()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(130)

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

Point.equals介绍

[英]Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.
[中]当此几何图形与其他几何图形具有完全相同的类型、特性和坐标时,返回TRUE。

代码示例

代码示例来源:origin: prestodb/presto

@SqlNullable
@Description("Returns TRUE if the LineString or Multi-LineString's start and end points are coincident")
@ScalarFunction("ST_IsClosed")
@SqlType(BOOLEAN)
public static Boolean stIsClosed(@SqlType(GEOMETRY_TYPE_NAME) Slice input)
{
  OGCGeometry geometry = deserialize(input);
  validateType("ST_IsClosed", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING));
  MultiPath lines = (MultiPath) geometry.getEsriGeometry();
  int pathCount = lines.getPathCount();
  for (int i = 0; i < pathCount; i++) {
    Point start = lines.getPoint(lines.getPathStart(i));
    Point end = lines.getPoint(lines.getPathEnd(i) - 1);
    if (!end.equals(start)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: com.esri.geometry/esri-geometry-api

static boolean mergeVertices(Point pt_1, Point pt_2, double w_1,
    int rank_1, double w_2, int rank_2, Point pt_res, double[] w_res,
    int[] rank_res) {
  assert (!pt_1.isEmpty() && !pt_2.isEmpty());
  boolean res = pt_1.equals(pt_2);
  if (rank_1 > rank_2) {
    pt_res = pt_1;
    if (w_res != null) {
      rank_res[0] = rank_1;
      w_res[0] = w_1;
    }
    return res;
  } else if (rank_2 > rank_1) {
    pt_res = pt_2;
    if (w_res != null) {
      rank_res[0] = rank_1;
      w_res[0] = w_1;
    }
    return res;
  }
  pt_res = pt_1;
  Point2D pt2d = new Point2D();
  mergeVertices2D(pt_1.getXY(), pt_2.getXY(), w_1, rank_1, w_2, rank_2,
      pt2d, w_res, rank_res);
  pt_res.setXY(pt2d);
  return res;
}

代码示例来源:origin: Esri/geometry-api-java

static boolean mergeVertices(Point pt_1, Point pt_2, double w_1,
    int rank_1, double w_2, int rank_2, Point pt_res, double[] w_res,
    int[] rank_res) {
  assert (!pt_1.isEmpty() && !pt_2.isEmpty());
  boolean res = pt_1.equals(pt_2);
  if (rank_1 > rank_2) {
    pt_res = pt_1;
    if (w_res != null) {
      rank_res[0] = rank_1;
      w_res[0] = w_1;
    }
    return res;
  } else if (rank_2 > rank_1) {
    pt_res = pt_2;
    if (w_res != null) {
      rank_res[0] = rank_1;
      w_res[0] = w_1;
    }
    return res;
  }
  pt_res = pt_1;
  Point2D pt2d = new Point2D();
  mergeVertices2D(pt_1.getXY(), pt_2.getXY(), w_1, rank_1, w_2, rank_2,
      pt2d, w_res, rank_res);
  pt_res.setXY(pt2d);
  return res;
}

代码示例来源:origin: com.facebook.presto/presto-geospatial

@SqlNullable
@Description("Returns TRUE if the LineString or Multi-LineString's start and end points are coincident")
@ScalarFunction("ST_IsClosed")
@SqlType(BOOLEAN)
public static Boolean stIsClosed(@SqlType(GEOMETRY_TYPE_NAME) Slice input)
{
  OGCGeometry geometry = deserialize(input);
  validateType("ST_IsClosed", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING));
  MultiPath lines = (MultiPath) geometry.getEsriGeometry();
  int pathCount = lines.getPathCount();
  for (int i = 0; i < pathCount; i++) {
    Point start = lines.getPoint(lines.getPathStart(i));
    Point end = lines.getPoint(lines.getPathEnd(i) - 1);
    if (!end.equals(start)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: prestosql/presto

@SqlNullable
@Description("Returns TRUE if the LineString or Multi-LineString's start and end points are coincident")
@ScalarFunction("ST_IsClosed")
@SqlType(BOOLEAN)
public static Boolean stIsClosed(@SqlType(GEOMETRY_TYPE_NAME) Slice input)
{
  OGCGeometry geometry = deserialize(input);
  validateType("ST_IsClosed", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING));
  MultiPath lines = (MultiPath) geometry.getEsriGeometry();
  int pathCount = lines.getPathCount();
  for (int i = 0; i < pathCount; i++) {
    Point start = lines.getPoint(lines.getPathStart(i));
    Point end = lines.getPoint(lines.getPathEnd(i) - 1);
    if (!end.equals(start)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: Esri/spatial-framework-for-hadoop

Point p0 = lines.getPoint(lines.getPathStart(ix));
Point pf = lines.getPoint(lines.getPathEnd(ix)-1);
rslt = rslt && pf.equals(p0);  // no tolerance - OGC

相关文章