Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Sep 23, 2023
1 parent 3bbfb48 commit 38ec4f9
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,15 @@ private enum Command {
* multipolygon.
*/
public static class VectorGeometryMerger implements Consumer<VectorGeometry> {
// For the most part this just concatenates the individual command arrays together
// EXCEPT we need to adjust the first coordinate of each subsequent linestring to
// be an offset from the end of the previous linestring.
// AND we need to combine all multipoint "move to" commands into one at the start of
// the sequence

private final GeometryType geometryType;
int overallX = 0;
int overallY = 0;
private int overallX = 0;
private int overallY = 0;
private final IntArrayList result = new IntArrayList();

private VectorGeometryMerger(GeometryType geometryType) {
Expand All @@ -609,9 +614,6 @@ public void accept(VectorGeometry vectorGeometry) {
int command = 0;
int i = 0;

// For the most part combining geometries just entails concatenating the commands
// EXCEPT we need to adjust the first coordinate of each subsequent linestring to
// be an offset from the end of the previous linestring
result.ensureCapacity(result.elementsCount + commands.length);
// and multipoints will end up with only one command ("move to" with length=# points)
if (geometryType != GeometryType.POINT || result.isEmpty()) {
Expand Down

0 comments on commit 38ec4f9

Please sign in to comment.