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

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

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

Point.isEmpty介绍

暂无

代码示例

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

private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
{
  Geometry esriGeometry = geometry.getEsriGeometry();
  verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  Point point = (Point) esriGeometry;
  verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
          !point.hasAttribute(VertexDescription.Semantics.M) &&
          !point.hasAttribute(VertexDescription.Semantics.ID),
      "Only 2D points with no ID nor M attribute are supported");
  output.appendByte(GeometrySerializationType.POINT.code());
  if (!point.isEmpty()) {
    output.appendDouble(point.getX());
    output.appendDouble(point.getY());
  }
  else {
    output.appendDouble(NaN);
    output.appendDouble(NaN);
  }
}

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

static Point difference(Point point, Point point2, double tolerance) {
  if (point.isEmpty())
    return (Point) point.createInstance();
  if (point2.isEmpty())
    return point;
  if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
      point2)) {
    return (Point) point.createInstance();
  }
  return point;
}

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

static Point difference(Point point, Point point2, double tolerance) {
  if (point.isEmpty())
    return (Point) point.createInstance();
  if (point2.isEmpty())
    return point;
  if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
      point2)) {
    return (Point) point.createInstance();
  }
  return point;
}

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

public static int isPointInPolygon(Polygon inputPolygon, Point inputPoint,
    double tolerance) {
  if (inputPoint.isEmpty())
    return 0;
  return isPointInPolygon(inputPolygon, inputPoint.getXY(), tolerance);
}

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

static Point intersection(Point point, Point point2, double tolerance) {
  if (point.isEmpty() || point2.isEmpty())
    return (Point) point.createInstance();
  if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
      point2)) {
    return CrackAndCluster.cluster_non_empty_points(point, point2, 1,
        1, 1, 1);
  }
  return (Point) point.createInstance();
}

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

static Point intersection(Point point, Point point2, double tolerance) {
  if (point.isEmpty() || point2.isEmpty())
    return (Point) point.createInstance();
  if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
      point2)) {
    return CrackAndCluster.cluster_non_empty_points(point, point2, 1,
        1, 1, 1);
  }
  return (Point) point.createInstance();
}

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

public static int isPointInPolygon(Polygon inputPolygon, Point inputPoint,
    double tolerance) {
  if (inputPoint.isEmpty())
    return 0;
  return isPointInPolygon(inputPolygon, inputPoint.getXY(), tolerance);
}

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

/**
 * Checks if this envelope contains (covers) the specified point.
 * 
 * @param p
 *            The Point to be tested for coverage.
 * @return TRUE if this envelope contains (covers) the specified point.
 */
public boolean contains(Point p) {
  if (p.isEmpty())
    return false;
  return m_envelope.contains(p.getX(), p.getY());
}

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

public void startPath(Point point) {
  if (point.isEmpty())
    throw new IllegalArgumentException();// throw new
                        // IllegalArgumentException();
  mergeVertexDescription(point.getDescription());
  _initPathStartPoint();
  point.copyTo(m_moveToPoint);
  // TODO check MultiPathImpl.cpp comment
  // "//the description will be merged later"
  // assignVertexDescription(m_moveToPoint.getDescription());
  m_bPathStarted = true;
}

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

public void startPath(Point point) {
  if (point.isEmpty())
    throw new IllegalArgumentException();// throw new
                        // IllegalArgumentException();
  mergeVertexDescription(point.getDescription());
  _initPathStartPoint();
  point.copyTo(m_moveToPoint);
  // TODO check MultiPathImpl.cpp comment
  // "//the description will be merged later"
  // assignVertexDescription(m_moveToPoint.getDescription());
  m_bPathStarted = true;
}

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

@Override
  public void replaceNaNs(int semantics, double value) {
    addAttribute(semantics);
    if (isEmpty())
      return;

    int ncomps = VertexDescription.getComponentCount(semantics);
    for (int i = 0; i < ncomps; i++) {
      double v = getAttributeAsDbl(semantics, i);
      if (Double.isNaN(v))
        setAttribute(semantics, i, value);
    }
  }
}

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

/**
 * Constructs an envelope that covers the given point. The coordinates of
 * the point are used to set the extent of the envelope.
 * 
 * @param point The point that the envelope covers.
 */
public Envelope(Point point) {
  m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D();
  m_envelope.setEmpty();
  if (point.isEmpty())
    return;
  _setFromPoint(point);
}

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

/**
 * Checks if this envelope contains (covers) the specified point.
 * 
 * @param p
 *            The Point to be tested for coverage.
 * @return TRUE if this envelope contains (covers) the specified point.
 */
public boolean contains(Point p) {
  if (p.isEmpty())
    return false;
  return m_envelope.contains(p.getX(), p.getY());
}

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

/**
 * Constructs an envelope that covers the given point. The coordinates of
 * the point are used to set the extent of the envelope.
 * 
 * @param point The point that the envelope covers.
 */
public Envelope(Point point) {
  m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D();
  m_envelope.setEmpty();
  if (point.isEmpty())
    return;
  _setFromPoint(point);
}

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

@Override
  public void replaceNaNs(int semantics, double value) {
    addAttribute(semantics);
    if (isEmpty())
      return;

    int ncomps = VertexDescription.getComponentCount(semantics);
    for (int i = 0; i < ncomps; i++) {
      double v = getAttributeAsDbl(semantics, i);
      if (Double.isNaN(v))
        setAttribute(semantics, i, value);
    }
  }
}

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

/**
 * Creates an envelope by defining its center, width, and height.
 * 
 * @param center
 *            The center point of the envelope.
 * @param width
 *            The width of the envelope.
 * @param height
 *            The height of the envelope.
 */
public Envelope(Point center, double width, double height) {
  m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D();
  m_envelope.setEmpty();
  if (center.isEmpty())
    return;
  _setFromPoint(center, width, height);
}

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

/**
 * Sets the envelope's corners to be centered around the specified point,
 * using its center, width, and height.
 * 
 * @param c
 *            The point around which to center the envelope.
 * @param w
 *            The width to be set for the envelope.
 * @param h
 *            The height to be set for this envelope.
 */
public void centerAt(Point c, double w, double h) {
  _touch();
  if (c.isEmpty()) {
    setEmpty();
    return;
  }
  _setFromPoint(c, w, h);
}

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

/**
 * Centers the envelope around the specified point preserving the envelope's
 * width and height.
 * 
 * @param c
 *            The new center point.
 */
public void centerAt(Point c) {
  _touch();
  if (c.isEmpty()) {
    setEmpty();
    return;
  }
  m_envelope.centerAt(c.getX(), c.getY());
}

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

/**
 * Centers the envelope around the specified point preserving the envelope's
 * width and height.
 * 
 * @param c
 *            The new center point.
 */
public void centerAt(Point c) {
  _touch();
  if (c.isEmpty()) {
    setEmpty();
    return;
  }
  m_envelope.centerAt(c.getX(), c.getY());
}

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

@Override
public void setPointByVal(int index, Point src) {
  if (index < 0 || index >= m_pointCount)
    throw new GeometryException("index out of bounds");
  Point point = src;
  if (src.isEmpty())// can not assign an empty point to a multipoint
            // vertex
    throw new IllegalArgumentException();
  _verifyAllStreams();// verify all allocated streams are of necessary
            // size.
  VertexDescription vdin = point.getDescription();
  for (int attributeIndex = 0; attributeIndex < vdin.getAttributeCount(); attributeIndex++) {
    int semantics = vdin._getSemanticsImpl(attributeIndex);
    int ncomp = VertexDescription.getComponentCount(semantics);
    for (int icomp = 0; icomp < ncomp; icomp++) {
      double v = point.getAttributeAsDbl(semantics, icomp);
      setAttribute(semantics, index, icomp, v);
    }
  }
}

相关文章