Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry.buffer with fixed precision removes hole #979

Open
FObermaier opened this issue May 24, 2023 · 1 comment
Open

Geometry.buffer with fixed precision removes hole #979

FObermaier opened this issue May 24, 2023 · 1 comment
Labels

Comments

@FObermaier
Copy link
Contributor

Calling Geometry.buffer(double) on a Polygon with interior ring that was created using a GeometryFactory with a fixed PrecisionModel might remove the interior ring:

  public void testBufferRemovesHole() throws ParseException {
    GeometryFactory gf = new GeometryFactory(new PrecisionModel(1000));
    Geometry geom = new WKTReader(gf).read("POLYGON ((0 0, 0 4, 4 4, 4 0, 2 0, 0 0), (2 0, 3 1, 2 2, 1 1, 2 0))");
    assertTrue(geom.isValid());
    geom = geom.buffer(0.001);
    assertTrue(geom.isValid());
    assertEquals(1, ((Polygon)geom).getNumInteriorRing());
  }

first reported: NetTopologySuite/NetTopologySuite#638

@dbotija-RatedPower
Copy link

It may be the same error I reported here, but with the interior hole being the geometry disappearing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants