Skip to content

Commit

Permalink
Move Striped and Tiled IndexTransform to trait file
Browse files Browse the repository at this point in the history
  • Loading branch information
echeipesh committed Dec 12, 2016
1 parent feddbfb commit e79d2a7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 32 deletions.
Expand Up @@ -51,3 +51,22 @@ trait GridIndexTransform {

def gridToIndex(col: Int, row: Int): Int
}


case class StripedSegmentTransform(segmentIndex: Int, segmentLayout: GeoTiffSegmentLayout) extends GridIndexTransform {
def gridToIndex(col: Int, row: Int): Int = {
val tileCol = col - (layoutCol * tileCols)
val tileRow = row - (layoutRow * tileRows)
tileRow * segmentCols + tileCol
}
}

case class TiledSegmentTransform(segmentIndex: Int, segmentLayout: GeoTiffSegmentLayout) extends GridIndexTransform {
def gridToIndex(col: Int, row: Int): Int = {
val tileCol = col - (layoutCol * tileCols)
val tileRow = row - (layoutRow * tileRows)
tileRow * tileCols + tileCol
}
}


This file was deleted.

This file was deleted.

0 comments on commit e79d2a7

Please sign in to comment.