Skip to content

Commit a71cb4b

Browse files
committed
Code cleanup
1 parent 5a17e45 commit a71cb4b

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Fix reprojection with downsampling for GeotiffRasterSource and tile RDDs. Reprojection outside the valid projection bounds may now throw a GeoAttrsError. [#3541](https://github.com/locationtech/geotrellis/issues/3541)
1414
- ConstantTile with NoData: support idempotent CellType conversions [#3553](https://github.com/locationtech/geotrellis/pull/3553)
1515
- GeoTiffReader Unknown tags skip fix [#3557](https://github.com/locationtech/geotrellis/pull/3557)
16+
-
1617

1718
## [3.7.1] - 2024-01-08
1819

raster/src/main/scala/geotrellis/raster/reproject/ReprojectRasterExtent.scala

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,8 @@ object ReprojectRasterExtent {
5757
val cols = ge.extent.width / ge.cellwidth
5858
val rows = ge.extent.height / ge.cellheight
5959
val pixelSize = distance / math.sqrt(cols * cols + rows * rows)
60-
val pixelWidth =
61-
if(newExtent.width <0.5*pixelSize) {
62-
newExtent.width
63-
}else{
64-
pixelSize
65-
}
66-
val pixelHeight =
67-
if(newExtent.height <0.5*pixelSize) {
68-
newExtent.height
69-
}else{
70-
pixelSize
71-
}
60+
val pixelWidth = if(newExtent.width < 0.5 * pixelSize) newExtent.width else pixelSize
61+
val pixelHeight = if(newExtent.height < 0.5*pixelSize) newExtent.height else pixelSize
7262
(pixelWidth, pixelHeight)
7363
}
7464

raster/src/test/scala/geotrellis/raster/reproject/ReprojectRasterExtentSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,11 @@ class ReprojectRasterExtentSpec extends AnyFunSpec
111111
}
112112

113113
it("should reproject single pixel extents") {
114-
val inputExtent = GridExtent[Long](Extent(429180.0, 7652390.0, 429190.0, 7652400.0), CellSize(10.0,10.0))
114+
val inputExtent = GridExtent[Long](Extent(429180.0, 7652390.0, 429190.0, 7652400.0), CellSize(10.0, 10.0))
115115
val destinationRE = ReprojectRasterExtent(inputExtent, CRS.fromEpsgCode(32639), LatLng)
116116

117117
assert(destinationRE.cols == 1)
118118
assert(destinationRE.rows == 1)
119-
120119
}
121120
}
122121
}

0 commit comments

Comments
 (0)