All Downloads are FREE. Search and download functionalities are using the official Maven repository.

geotrellis.raster.resample.ResampleMethods.scala Maven / Gradle / Ivy

Go to download

GeoTrellis is an open source geographic data processing engine for high performance applications.

There is a newer version: 0.10.3
Show newest version
package geotrellis.raster.resample

import geotrellis.raster._
import geotrellis.vector.Extent
import geotrellis.util.MethodExtensions

import spire.syntax.cfor._


trait ResampleMethods[T <: CellGrid] extends MethodExtensions[T] {
  def resample(extent: Extent, targetExtent: RasterExtent, method: ResampleMethod): T

  def resample(source: Extent, target: RasterExtent): T =
    resample(source, target, ResampleMethod.DEFAULT)

  def resample(source: Extent, target: Extent): T =
    resample(source, target, ResampleMethod.DEFAULT)

  def resample(extent: Extent, targetExtent: Extent, method: ResampleMethod): T =
    resample(extent, RasterExtent(extent, self.cols, self.rows).createAlignedRasterExtent(targetExtent), method)

  def resample(extent: Extent, targetCols: Int, targetRows: Int): T =
    resample(extent, targetCols, targetRows, ResampleMethod.DEFAULT)

  def resample(extent: Extent, targetCols: Int, targetRows: Int, method: ResampleMethod): T =
    resample(extent, RasterExtent(extent, targetCols, targetRows), method)

  /** Only changes the resolution */
  def resample(targetCols: Int, targetRows: Int): T =
    resample(Extent(0.0, 0.0, 1.0, 1.0), targetCols, targetRows)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy