Skip to content

Commit 6d956f3

Browse files
committed
gridBoundsRelative => relativeGridBounds
1 parent db1bfd0 commit 6d956f3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

layer/src/main/scala/geotrellis/layer/LayoutTileSource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class LayoutTileSource[K: SpatialComponent](
8989
* val rowOffset = bounds.rowMin - sourcePixelBounds.rowMin
9090
*
9191
* However, if the source is a [[MosaicRasterSource]], offsets are still relative to the underlying [[RasterSource]].
92-
* In this case it is possible offsets through the returned extent.
92+
* In this case it is possible to compute offsets through the returned extent.
9393
*/
9494

9595
// the actual returned extent

raster/src/main/scala/geotrellis/raster/MosaicRasterSource.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@ abstract class MosaicRasterSource extends RasterSource {
100100
*
101101
* This is done by calculating the relative offset using each [[RasterSource]]
102102
* underlying [[Extent]].
103+
104+
* @param gb global bounds, relative to the [[MosaicRasterSource]]
105+
* @param extent extent of the [[RasterSource]]
106+
* @return relative to the extent [[GridBounds]]
103107
*/
104-
def gridBoundsRelative(gb: GridBounds[Long], extent: Extent): GridBounds[Long] = {
108+
def relativeGridBounds(gb: GridBounds[Long], extent: Extent): GridBounds[Long] = {
105109
val GridBounds(colMin, rowMin, colMax, rowMax) = gb
106110

107111
val sourceColOffset = GridExtent.floorWithTolerance((extent.xmin - gridExtent.extent.xmin) / gridExtent.cellwidth).toLong
@@ -115,7 +119,7 @@ abstract class MosaicRasterSource extends RasterSource {
115119
)
116120
}
117121

118-
val rasters = sources.map { rs => rs.read(gridBoundsRelative(bounds, rs.extent), bands) }
122+
val rasters = sources.map { rs => rs.read(relativeGridBounds(bounds, rs.extent), bands) }
119123
rasters.reduce
120124
}
121125

0 commit comments

Comments
 (0)