diff --git a/raster/src/main/scala/geotrellis/raster/viewshed/R2Viewshed.scala b/raster/src/main/scala/geotrellis/raster/viewshed/R2Viewshed.scala index cbf469ade7..8bd89475c2 100644 --- a/raster/src/main/scala/geotrellis/raster/viewshed/R2Viewshed.scala +++ b/raster/src/main/scala/geotrellis/raster/viewshed/R2Viewshed.scala @@ -347,7 +347,7 @@ object R2Viewshed extends Serializable { val seg = northSegs(i) alpha = thetaToAlpha(from, rays, seg.theta); terminated = false Rasterizer.foreachCellInGridLine(seg.x0, seg.y0, seg.x1, seg.y1, null, re, false)(callback) - if (!terminated && !seg.isRumpSegment) southRays.append(Ray(seg.theta, alpha)) + if (!terminated && !seg.isRumpSegment) (southRays += Ray(seg.theta, alpha)) i += 1 } @@ -358,7 +358,7 @@ object R2Viewshed extends Serializable { val seg = southSegs(i) alpha = thetaToAlpha(from, rays, seg.theta); terminated = false Rasterizer.foreachCellInGridLine(seg.x0, seg.y0, seg.x1, seg.y1, null, re, false)(callback) - if (!terminated && !seg.isRumpSegment) northRays.append(Ray(seg.theta, alpha)) + if (!terminated && !seg.isRumpSegment) (northRays += Ray(seg.theta, alpha)) i += 1 } @@ -377,7 +377,7 @@ object R2Viewshed extends Serializable { val seg = eastSegs(i) alpha = thetaToAlpha(from, rays, seg.theta); terminated = false Rasterizer.foreachCellInGridLine(seg.x0, seg.y0, seg.x1, seg.y1, null, re, false)(callback) - if (!terminated && !seg.isRumpSegment) westRays.append(Ray(seg.theta, alpha)) + if (!terminated && !seg.isRumpSegment) (westRays += Ray(seg.theta, alpha)) i += 1 } } @@ -397,7 +397,7 @@ object R2Viewshed extends Serializable { val seg = westSegs(i) alpha = thetaToAlpha(from, rays, seg.theta); terminated = false Rasterizer.foreachCellInGridLine(seg.x0, seg.y0, seg.x1, seg.y1, null, re, false)(callback) - if (!terminated && !seg.isRumpSegment) eastRays.append(Ray(seg.theta, alpha)) + if (!terminated && !seg.isRumpSegment) (eastRays += Ray(seg.theta, alpha)) i += 1 } } diff --git a/spark/src/main/scala/geotrellis/spark/costdistance/IterativeCostDistance.scala b/spark/src/main/scala/geotrellis/spark/costdistance/IterativeCostDistance.scala index e95bdac0d7..66b1b50c99 100644 --- a/spark/src/main/scala/geotrellis/spark/costdistance/IterativeCostDistance.scala +++ b/spark/src/main/scala/geotrellis/spark/costdistance/IterativeCostDistance.scala @@ -65,7 +65,7 @@ object IterativeCostDistance { other } def add(pair: KeyCostPair): Unit = { - this.synchronized { list.append(pair) } + this.synchronized { list += pair } } def isZero: Boolean = list.isEmpty def merge(other: AccumulatorV2[KeyCostPair, Changes]): Unit = @@ -96,7 +96,7 @@ object IterativeCostDistance { var row = bounds.rowMin; while (row <= bounds.rowMax) { var col = bounds.colMin; while (col <= bounds.colMax) { - keys.append(SpatialKey(col, row)) + keys += SpatialKey(col, row) col += 1 } row += 1 diff --git a/vectortile/src/main/scala/geotrellis/vectortile/Layer.scala b/vectortile/src/main/scala/geotrellis/vectortile/Layer.scala index 3691226e1c..67ffd8f80a 100644 --- a/vectortile/src/main/scala/geotrellis/vectortile/Layer.scala +++ b/vectortile/src/main/scala/geotrellis/vectortile/Layer.scala @@ -339,9 +339,9 @@ ${sortedMeta.map({ case (k,v) => s" ${k}: ${v}"}).mkString("\n")} features.foreach { f => f.getType match { - case POINT => points.append(f) - case LINESTRING => lines.append(f) - case POLYGON => polys.append(f) + case POINT => points += f + case LINESTRING => lines += f + case POLYGON => polys += f case _ => Unit // `UNKNOWN` or `Unrecognized`. } } diff --git a/vectortile/src/main/scala/geotrellis/vectortile/internal/package.scala b/vectortile/src/main/scala/geotrellis/vectortile/internal/package.scala index 65420eb83c..d438a2bf79 100644 --- a/vectortile/src/main/scala/geotrellis/vectortile/internal/package.scala +++ b/vectortile/src/main/scala/geotrellis/vectortile/internal/package.scala @@ -54,7 +54,7 @@ package object internal { case (dx, dy) => val here = (dx + cursor._1, dy + cursor._2) - points.append(here) + points += here cursor = here }) @@ -252,7 +252,7 @@ package object internal { val nextCursor: (Int, Int) = points.last /* Add the starting point to close the Line into a Polygon */ - points.append(here) + points += here work(rest, lines += points, nextCursor) } @@ -280,10 +280,10 @@ package object internal { val area = surveyor(line) if (area < 0) { /* New Interior Rings */ - holes.append(tr(line)) + holes += tr(line) } else { /* New Exterior Ring */ /* Save the current state */ - polys.append(Polygon(tr(currL), holes)) + polys += Polygon(tr(currL), holes) /* Reset the state */ currL = line @@ -292,7 +292,7 @@ package object internal { }) /* Save the final state */ - polys.append(Polygon(tr(currL), holes)) + polys += Polygon(tr(currL), holes) if (polys.length == 1) Left(polys.head) else Right(MultiPolygon(polys)) }