geotrellis.spark.io.s3.MultibandGeoTiffS3InputFormat.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geotrellis-s3_2.10 Show documentation
Show all versions of geotrellis-s3_2.10 Show documentation
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