geotrellis.raster.resample.MultibandRasterResampleMethods.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geotrellis-raster_2.11 Show documentation
Show all versions of geotrellis-raster_2.11 Show documentation
GeoTrellis is an open source geographic data processing engine for high performance applications.
The newest version!
package geotrellis.raster.resample
import geotrellis.raster._
import geotrellis.vector.Extent
import spire.syntax.cfor._
trait MultibandRasterResampleMethods extends RasterResampleMethods[MultibandRaster] {
def resample(target: RasterExtent, method: ResampleMethod): MultibandRaster = {
val tile = self.tile
val extent = self.extent
val bandCount = tile.bandCount
val resampledBands = Array.ofDim[Tile](bandCount)
cfor(0)(_ < bandCount, _ + 1) { b =>
resampledBands(b) = Raster(tile.band(b), extent).resample(target, method).tile
}
Raster(ArrayMultibandTile(resampledBands), target.extent)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy