Skip to content

Commit

Permalink
Fixed bug in GeoTiffMultibandTile.crop that prevented GeoTiffs with t…
Browse files Browse the repository at this point in the history
…iled segments and band interleave from being cropped correctly

Signed-off-by: Jacob Bouffard <jbouffard@azavea.com>

Added crop fix to the CHANGELOG

Signed-off-by: Jacob Bouffard <jbouffard@azavea.com>

Added crop band fix to CHANGELOG

Signed-off-by: Jacob Bouffard <jbouffard@azavea.com>
  • Loading branch information
Jacob Bouffard authored and echeipesh committed Jul 27, 2018
1 parent d452a8b commit 8613bf2
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,10 @@ abstract class GeoTiffMultibandTile(
}


def burnBandInterleave(segmentId: Int, offsetId: Int, subsetBandIndex: Int, segment: GeoTiffSegment): List[Chip] = {
def burnBandInterleave(segmentId: Int, subsetBandIndex: Int, segment: GeoTiffSegment): List[Chip] = {
var finished: List[Chip] = Nil
val segmentBounds = getGridBounds(offsetId)
val segmentTransform = getSegmentTransform(offsetId)
val segmentBounds = getGridBounds(segmentId)
val segmentTransform = getSegmentTransform(segmentId)

for (chip <- chipsBySegment(segmentId)) {
val gridBounds = chip.window
Expand Down Expand Up @@ -648,10 +648,8 @@ abstract class GeoTiffMultibandTile(
getSegments(intersectingSegments.map(_._2)).flatMap { case (segmentId, segment) =>
val bandIndex = segmentBandMap(segmentId)
val subsetBandIndex = bandIndexToSubsetIndex(bandIndex)
val segmentOffset = bandSegmentCount * subsetBandIndex
val offsetId = segmentId - segmentOffset

burnBandInterleave(segmentId, offsetId, subsetBandIndex, segment)
burnBandInterleave(segmentId, subsetBandIndex, segment)
}
}

Expand Down

0 comments on commit 8613bf2

Please sign in to comment.