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

geotrellis.spark.partition.SpatiallyPartition.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.partition

import geotrellis.spark._
import geotrellis.util._

import org.apache.spark.rdd._

import scala.reflect.ClassTag

object SpatiallyPartition {
  def apply[
    K: Boundable: PartitionerIndex: ClassTag,
    V: ClassTag,
    M: GetComponent[?, Bounds[K]]
  ](rdd: RDD[(K, V)] with Metadata[M]): RDD[(K, V)] with Metadata[Bounds[K]] =
    apply(rdd, rdd.metadata.getComponent[Bounds[K]])

  def apply[
    K: Boundable: PartitionerIndex: ClassTag,
    V: ClassTag,
    M: GetComponent[?, Bounds[K]]
  ](rdd: RDD[(K, V)] with Metadata[M], filterBounds: Bounds[K]): RDD[(K, V)] with Metadata[Bounds[K]] = {
    val partitioner = SpacePartitioner(filterBounds)
    partitioner(rdd)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy