
geotrellis.raster.io.geotiff.UByteGeoTiffSegmentCollection.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geotrellis-raster_2.10 Show documentation
Show all versions of geotrellis-raster_2.10 Show documentation
GeoTrellis is an open source geographic data processing engine for high performance applications.
The newest version!
package geotrellis.raster.io.geotiff
import geotrellis.raster._
import geotrellis.raster.io.geotiff.compression._
trait UByteGeoTiffSegmentCollection extends GeoTiffSegmentCollection {
type T = UByteGeoTiffSegment
def noDataValue: Option[Int]
val bandType = UByteBandType
lazy val createSegment: Int => UByteGeoTiffSegment = noDataValue match {
case None =>
{ i: Int => new UByteRawGeoTiffSegment(getDecompressedBytes(i)) }
case Some(nd) if (nd == 0.toShort) =>
{ i: Int => new UByteConstantNoDataCellTypeGeoTiffSegment(getDecompressedBytes(i)) }
case Some(nd) => // Cast nodata to int in this case so that we can properly compare it to the upcast unsigned byte
{ i: Int => new UByteUserDefinedNoDataGeoTiffSegment(getDecompressedBytes(i), nd.toByte) }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy