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

Fixed Extent.translate #3480

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Revert graceful JTS fall back and lazy Circe encoders [#3463](https://github.com/locationtech/geotrellis/issues/3463)
- Update Cassandra up to 4.x [#3382](https://github.com/locationtech/geotrellis/issues/3382)
- Accumulo update up to 1.10.x [#3476](https://github.com/locationtech/geotrellis/pull/3476)
- Fixed Extent.translate [#3480](https://github.com/locationtech/geotrellis/pull/3480)

## [3.6.3] - 2022-07-12

Expand Down
2 changes: 1 addition & 1 deletion vector/src/main/scala/geotrellis/vector/Extent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ case class Extent(
xmin + deltaX,
ymin + deltaY,
xmax + deltaX,
ymin + deltaY
ymax + deltaY
)

/** Return this extent as a polygon */
Expand Down
4 changes: 4 additions & 0 deletions vector/src/test/scala/geotrellis/vector/ExtentSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class ExtentSpec extends AnyFunSpec with Matchers {
intercept[ExtentRangeError] { Extent(10.0, 0.0, 0.0, 10.0) }
intercept[ExtentRangeError] { Extent(0.0, 10.0, 10.0, 0.0) }
}
it("should return correct results for translate") {
assert(Extent(0,0,1,1).translate(1.1, 2.2) == Extent(1.1, 2.2, 2.1, 3.2))
assert(Extent(0,0,1,1).translate(1.1, 2.2) != Extent(1.1, 2.2, 2.1, 2.2))
}

it("should compare extents") {
val e1 = Extent(0.0, 0.0, 10.0, 10.0)
Expand Down