Skip to content

Convex Hull of One Point #288

Description

@randallwhitman

Expected: non-empty degenerate polygon.
Actual: empty geometry.
Is there a different way I should be calling the convex-hull operator?
Relates SF4H-181.

  private static class OnePointCursor extends GeometryCursor {
    private boolean flag = true;
    OnePointCursor() {}
    public Geometry next() {
      if (flag) {
        flag = false;
        return new Point(1.2, 3.4);
      } else
        return null;
    }
    public int getGeometryID() {
      throw new UnsupportedOperationException();
    }
  }

  @Test
  public static void testOnePoint() {
    GeometryCursor geomCursor = new OnePointCursor();
    GeometryCursor convexResult = OperatorConvexHull.local().execute(geomCursor, true, null);
    Geometry result = convexResult.next();
    System.err.println(result);  // {"rings":[]}
    assertFalse(result.isEmpty());  // junit.framework.AssertionFailedError
  }

cc @JordanMLee

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions