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

geotrellis.spark.io.s3.MultibandGeoTiffS3InputFormat.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.io.s3

import geotrellis.raster._
import geotrellis.raster.io.geotiff._
import geotrellis.vector._
import org.apache.hadoop.mapreduce.{InputSplit, TaskAttemptContext}

/** Read multi band GeoTiff from S3 */
class MultibandGeoTiffS3InputFormat extends S3InputFormat[ProjectedExtent, MultibandTile] {
  def createRecordReader(split: InputSplit, context: TaskAttemptContext) =
    new S3RecordReader[ProjectedExtent, MultibandTile] {
      def read(key: String, bytes: Array[Byte]) = {
        val geoTiff = MultibandGeoTiff(bytes)
        val projectedExtent = ProjectedExtent(geoTiff.extent, geoTiff.crs)
        (projectedExtent, geoTiff.tile)
      }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy