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

geotrellis.raster.op.global.GlobalOpMethods.scala Maven / Gradle / Ivy

The newest version!
package geotrellis.raster.op.global

import geotrellis._
import geotrellis.raster._
import geotrellis.source._

trait GlobalOpMethods[+Repr <: RasterSource] { self: Repr =>
  def rescale(newMin:Int,newMax:Int) = {
    self.global { r =>
      val (min,max) = r.findMinMax
      r.normalize(min,max,newMin,newMax)
    }
  }

  def toVector() = 
    self.converge.mapOp(ToVector(_))

  def asArray() = 
    self.converge.mapOp(AsArray(_))

  def regionGroup(options:RegionGroupOptions = RegionGroupOptions.default) =
    self.converge.mapOp(RegionGroup(_,options))

  def verticalFlip() =
    self.globalOp(VerticalFlip(_))

  def costDistance(points: Seq[(Int,Int)]) = 
    self.globalOp(CostDistance(_,points))

  def convolve(kernel:Kernel) =
    self.globalOp(Convolve(_,kernel))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy