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

geotrellis.spark.etl.hadoop.GeoTiffSequenceHadoopInput.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.etl.hadoop

import geotrellis.raster.Tile
import geotrellis.raster.io.geotiff.reader.GeoTiffReader
import geotrellis.spark._
import geotrellis.vector.ProjectedExtent
import geotrellis.spark.ingest._
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

class GeoTiffSequenceHadoopInput extends HadoopInput[ProjectedExtent, Tile] {
  val format = "geotiff-sequence"
  def apply(props: Parameters)(implicit sc: SparkContext): RDD[(ProjectedExtent, Tile)] =
    sc
      .sequenceFile[String, Array[Byte]](props("path"))
      .map { case (path, bytes) =>
        val geotiff = GeoTiffReader.readSingleband(bytes)
        (ProjectedExtent(geotiff.extent, geotiff.crs), geotiff.tile)
      }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy