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

geotrellis.spark.CellGridLayoutRDDMethods.scala Maven / Gradle / Ivy

Go to download

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

The newest version!
package geotrellis.spark

import geotrellis.raster._
import geotrellis.spark.tiling.LayoutDefinition
import geotrellis.util._

import org.apache.spark.rdd._

import scala.reflect.ClassTag

abstract class CellGridLayoutRDDMethods[K: SpatialComponent: ClassTag, V <: CellGrid, M: GetComponent[?, LayoutDefinition]]
    extends MethodExtensions[RDD[(K, V)] with Metadata[M]] {
  def asRasters(): RDD[(K, Raster[V])] = {
    val mapTransform = self.metadata.getComponent[LayoutDefinition].mapTransform
    self.mapPartitions({ part =>
      part.map { case (key, tile) =>
        (key, Raster(tile, mapTransform(key)))
      }
    }, true)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy