locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.94k stars 442 forks source link

Improve use of isFreeRing in createEdges #970

Closed FObermaier closed 1 year ago

FObermaier commented 1 year ago

The instance field isFreeRing refers to the geometry in the instance field inputLines. It has nothing to do with the geometry in the instance field constraintLines and thus should not be applied to it.

dr-jts commented 1 year ago

Good point, thanks.

Even better I think is to not create an empty BitSet if isFreeRing is null, but to do this instead:

      boolean isFree = isFreeRing == null ? false : isFreeRing.get(i);
      edges.add(new Edge(line, isFree, areaTolerance));

If you agree, do you want to update this PR?