Skip to content

Commit

Permalink
GridBounds: coordsIter output should match coords
Browse files Browse the repository at this point in the history
  • Loading branch information
fosskers committed Jul 21, 2017
1 parent d93600e commit 3d987f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,13 @@ class GridBoundsSpec extends FunSpec with Matchers{
GridBounds.distinct(gridBounds).map(_.size).sum should be ((101 * 101) - (25 * 25 * 2))
}
}

describe("GridBounds.coords") {
// TODO This test can be removed in 2.0
it("should match the output of coordsIter") {
val gbs = GridBounds(0, 0, 10, 10)

gbs.coordsIter.toSeq shouldBe gbs.coords.toSeq
}
}
}
2 changes: 1 addition & 1 deletion raster/src/main/scala/geotrellis/raster/GridBounds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ case class GridBounds(colMin: Int, rowMin: Int, colMax: Int, rowMax: Int) {
def coordsIter: Iterator[(Int, Int)] = for {
row <- Iterator.range(0, height)
col <- Iterator.range(0, width)
} yield (row, col)
} yield (col, row)

/**
* Return the intersection of the present [[GridBounds]] and the
Expand Down

0 comments on commit 3d987f2

Please sign in to comment.