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

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

本文整理了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

  1. private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry)
  2. {
  3. Geometry esriGeometry = geometry.getEsriGeometry();
  4. verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point");
  5. Point point = (Point) esriGeometry;
  6. verify(!point.hasAttribute(VertexDescription.Semantics.Z) &&
  7. !point.hasAttribute(VertexDescription.Semantics.M) &&
  8. !point.hasAttribute(VertexDescription.Semantics.ID),
  9. "Only 2D points with no ID nor M attribute are supported");
  10. output.appendByte(GeometrySerializationType.POINT.code());
  11. if (!point.isEmpty()) {
  12. output.appendDouble(point.getX());
  13. output.appendDouble(point.getY());
  14. }
  15. else {
  16. output.appendDouble(NaN);
  17. output.appendDouble(NaN);
  18. }
  19. }

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

  1. static Point difference(Point point, Point point2, double tolerance) {
  2. if (point.isEmpty())
  3. return (Point) point.createInstance();
  4. if (point2.isEmpty())
  5. return point;
  6. if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
  7. point2)) {
  8. return (Point) point.createInstance();
  9. }
  10. return point;
  11. }

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

  1. static Point difference(Point point, Point point2, double tolerance) {
  2. if (point.isEmpty())
  3. return (Point) point.createInstance();
  4. if (point2.isEmpty())
  5. return point;
  6. if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
  7. point2)) {
  8. return (Point) point.createInstance();
  9. }
  10. return point;
  11. }

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

  1. public static int isPointInPolygon(Polygon inputPolygon, Point inputPoint,
  2. double tolerance) {
  3. if (inputPoint.isEmpty())
  4. return 0;
  5. return isPointInPolygon(inputPolygon, inputPoint.getXY(), tolerance);
  6. }

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

  1. static Point intersection(Point point, Point point2, double tolerance) {
  2. if (point.isEmpty() || point2.isEmpty())
  3. return (Point) point.createInstance();
  4. if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
  5. point2)) {
  6. return CrackAndCluster.cluster_non_empty_points(point, point2, 1,
  7. 1, 1, 1);
  8. }
  9. return (Point) point.createInstance();
  10. }

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

  1. static Point intersection(Point point, Point point2, double tolerance) {
  2. if (point.isEmpty() || point2.isEmpty())
  3. return (Point) point.createInstance();
  4. if (CrackAndCluster.non_empty_points_need_to_cluster(tolerance, point,
  5. point2)) {
  6. return CrackAndCluster.cluster_non_empty_points(point, point2, 1,
  7. 1, 1, 1);
  8. }
  9. return (Point) point.createInstance();
  10. }

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

  1. public static int isPointInPolygon(Polygon inputPolygon, Point inputPoint,
  2. double tolerance) {
  3. if (inputPoint.isEmpty())
  4. return 0;
  5. return isPointInPolygon(inputPolygon, inputPoint.getXY(), tolerance);
  6. }

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

  1. /**
  2. * Checks if this envelope contains (covers) the specified point.
  3. *
  4. * @param p
  5. * The Point to be tested for coverage.
  6. * @return TRUE if this envelope contains (covers) the specified point.
  7. */
  8. public boolean contains(Point p) {
  9. if (p.isEmpty())
  10. return false;
  11. return m_envelope.contains(p.getX(), p.getY());
  12. }

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

  1. public void startPath(Point point) {
  2. if (point.isEmpty())
  3. throw new IllegalArgumentException();// throw new
  4. // IllegalArgumentException();
  5. mergeVertexDescription(point.getDescription());
  6. _initPathStartPoint();
  7. point.copyTo(m_moveToPoint);
  8. // TODO check MultiPathImpl.cpp comment
  9. // "//the description will be merged later"
  10. // assignVertexDescription(m_moveToPoint.getDescription());
  11. m_bPathStarted = true;
  12. }

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

  1. public void startPath(Point point) {
  2. if (point.isEmpty())
  3. throw new IllegalArgumentException();// throw new
  4. // IllegalArgumentException();
  5. mergeVertexDescription(point.getDescription());
  6. _initPathStartPoint();
  7. point.copyTo(m_moveToPoint);
  8. // TODO check MultiPathImpl.cpp comment
  9. // "//the description will be merged later"
  10. // assignVertexDescription(m_moveToPoint.getDescription());
  11. m_bPathStarted = true;
  12. }

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

  1. @Override
  2. public void replaceNaNs(int semantics, double value) {
  3. addAttribute(semantics);
  4. if (isEmpty())
  5. return;
  6. int ncomps = VertexDescription.getComponentCount(semantics);
  7. for (int i = 0; i < ncomps; i++) {
  8. double v = getAttributeAsDbl(semantics, i);
  9. if (Double.isNaN(v))
  10. setAttribute(semantics, i, value);
  11. }
  12. }
  13. }

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

  1. /**
  2. * Constructs an envelope that covers the given point. The coordinates of
  3. * the point are used to set the extent of the envelope.
  4. *
  5. * @param point The point that the envelope covers.
  6. */
  7. public Envelope(Point point) {
  8. m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D();
  9. m_envelope.setEmpty();
  10. if (point.isEmpty())
  11. return;
  12. _setFromPoint(point);
  13. }

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

  1. /**
  2. * Checks if this envelope contains (covers) the specified point.
  3. *
  4. * @param p
  5. * The Point to be tested for coverage.
  6. * @return TRUE if this envelope contains (covers) the specified point.
  7. */
  8. public boolean contains(Point p) {
  9. if (p.isEmpty())
  10. return false;
  11. return m_envelope.contains(p.getX(), p.getY());
  12. }

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

  1. /**
  2. * Constructs an envelope that covers the given point. The coordinates of
  3. * the point are used to set the extent of the envelope.
  4. *
  5. * @param point The point that the envelope covers.
  6. */
  7. public Envelope(Point point) {
  8. m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D();
  9. m_envelope.setEmpty();
  10. if (point.isEmpty())
  11. return;
  12. _setFromPoint(point);
  13. }

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

  1. @Override
  2. public void replaceNaNs(int semantics, double value) {
  3. addAttribute(semantics);
  4. if (isEmpty())
  5. return;
  6. int ncomps = VertexDescription.getComponentCount(semantics);
  7. for (int i = 0; i < ncomps; i++) {
  8. double v = getAttributeAsDbl(semantics, i);
  9. if (Double.isNaN(v))
  10. setAttribute(semantics, i, value);
  11. }
  12. }
  13. }

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

  1. /**
  2. * Creates an envelope by defining its center, width, and height.
  3. *
  4. * @param center
  5. * The center point of the envelope.
  6. * @param width
  7. * The width of the envelope.
  8. * @param height
  9. * The height of the envelope.
  10. */
  11. public Envelope(Point center, double width, double height) {
  12. m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D();
  13. m_envelope.setEmpty();
  14. if (center.isEmpty())
  15. return;
  16. _setFromPoint(center, width, height);
  17. }

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

  1. /**
  2. * Sets the envelope's corners to be centered around the specified point,
  3. * using its center, width, and height.
  4. *
  5. * @param c
  6. * The point around which to center the envelope.
  7. * @param w
  8. * The width to be set for the envelope.
  9. * @param h
  10. * The height to be set for this envelope.
  11. */
  12. public void centerAt(Point c, double w, double h) {
  13. _touch();
  14. if (c.isEmpty()) {
  15. setEmpty();
  16. return;
  17. }
  18. _setFromPoint(c, w, h);
  19. }

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

  1. /**
  2. * Centers the envelope around the specified point preserving the envelope's
  3. * width and height.
  4. *
  5. * @param c
  6. * The new center point.
  7. */
  8. public void centerAt(Point c) {
  9. _touch();
  10. if (c.isEmpty()) {
  11. setEmpty();
  12. return;
  13. }
  14. m_envelope.centerAt(c.getX(), c.getY());
  15. }

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

  1. /**
  2. * Centers the envelope around the specified point preserving the envelope's
  3. * width and height.
  4. *
  5. * @param c
  6. * The new center point.
  7. */
  8. public void centerAt(Point c) {
  9. _touch();
  10. if (c.isEmpty()) {
  11. setEmpty();
  12. return;
  13. }
  14. m_envelope.centerAt(c.getX(), c.getY());
  15. }

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

  1. @Override
  2. public void setPointByVal(int index, Point src) {
  3. if (index < 0 || index >= m_pointCount)
  4. throw new GeometryException("index out of bounds");
  5. Point point = src;
  6. if (src.isEmpty())// can not assign an empty point to a multipoint
  7. // vertex
  8. throw new IllegalArgumentException();
  9. _verifyAllStreams();// verify all allocated streams are of necessary
  10. // size.
  11. VertexDescription vdin = point.getDescription();
  12. for (int attributeIndex = 0; attributeIndex < vdin.getAttributeCount(); attributeIndex++) {
  13. int semantics = vdin._getSemanticsImpl(attributeIndex);
  14. int ncomp = VertexDescription.getComponentCount(semantics);
  15. for (int icomp = 0; icomp < ncomp; icomp++) {
  16. double v = point.getAttributeAsDbl(semantics, icomp);
  17. setAttribute(semantics, index, icomp, v);
  18. }
  19. }
  20. }

相关文章