geotrellis.data.geotiff

Encoder

class Encoder extends AnyRef

Class for writing GeoTIFF data to a given DataOutputStream.

This class implements the basic TIFF spec [1] and also supports the GeoTIFF extension tags. It is not a general purpose TIFF encoder (it doesn't support renderings involving colors, multiband images, etc) but works well for encoding raster data.

It uses a single sample per pixel and encodes the data in one band. This means that files using more than 8-bit samples will often not render correctly in image programs like the Gimp. It also does not implement compression yet.

Future work may add compression options, as well as options related to the color palette, multiple bands, etc.

Encoders are not thread-safe and can only be used to write a single raster to single output stream. This is a consequence of how reliant the TIFF format is on embedding data addresses.

[1] http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf

Linear Supertypes
AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Encoder
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Encoder(dos: DataOutputStream, raster: Raster, settings: Settings)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Encoder to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (Encoder, B)

    Implicit information
    This member is added by an implicit conversion from Encoder to ArrowAssoc[Encoder] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. val baos: ByteArrayOutputStream

  10. final def bitsPerSample: Int

    Number of bits per sample.

    Number of bits per sample. Should either be a multiple of 8, or evenly divide 8 (i.e. 1, 2 or 4).

  11. final def bytesPerRow: Int

    Here we do a bunch of calculations around strip size.

    Here we do a bunch of calculations around strip size. We limit each strip to 65K in size. Given that constraint, we can determine how many strips we need, how large each strip is, how many rows per strip we'll write, etc.

  12. final def bytesPerSample: Int

  13. final def bytesPerStrip: Int

  14. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. val cols: Int

  16. val data: ArrayRasterData

  17. final def dataOffset: Int

  18. val e: Extent

  19. def ensuring(cond: (Encoder) ⇒ Boolean, msg: ⇒ Any): Encoder

    Implicit information
    This member is added by an implicit conversion from Encoder to Ensuring[Encoder] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: (Encoder) ⇒ Boolean): Encoder

    Implicit information
    This member is added by an implicit conversion from Encoder to Ensuring[Encoder] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: Boolean, msg: ⇒ Any): Encoder

    Implicit information
    This member is added by an implicit conversion from Encoder to Ensuring[Encoder] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: Boolean): Encoder

    Implicit information
    This member is added by an implicit conversion from Encoder to Ensuring[Encoder] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  25. final def esriCompat: Boolean

    ESRI compatibility changes the data we write out.

    ESRI compatibility changes the data we write out. It results in some extra TIFF tags and many extra GeoTIFF tags.

  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from Encoder to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  28. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. final def ifdOffset: Int

  31. final def imageStartOffset: Int

  32. val img: ByteArrayOutputStream

  33. var index: Int

  34. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  35. final def leftOverRows: Int

  36. final def maxRowsPerStrip: Int

  37. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  38. final def noDataInt: Int

    Int nodata value to use when writing raster.

  39. final def noDataString: String

    String nodata value to use in GeoTIFF metadata.

  40. final def notify(): Unit

    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  42. final def numEntries: Int

    The number of TIFF tags to be written.

    The number of TIFF tags to be written.

    If we update the writer to support additional TIFF tags this number needs to be increased also. The writeTag calls in write are numbered to help make this process easier.

  43. final def numGeoTags: Int

    The number of GeoTags to be written.

    The number of GeoTags to be written.

    If we write extra GeoTIFF tags this number needs to be increased.

  44. final def numStrips: Int

  45. val re: RasterExtent

  46. def renderImage(): (Array[Int], Array[Int])

    Render the raster data into strips, and return an array of file offsets for each strip.

    Render the raster data into strips, and return an array of file offsets for each strip. The strips may (or may not) be compressed.

  47. val rows: Int

  48. final def rowsPerStrip: Int

  49. final def sampleFormat: Int

    Type of samples, using numeric constants from the TIFF spec.

  50. val settings: Settings

  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  52. def toString(): String

    Definition Classes
    AnyRef → Any
  53. val todo: DataOutputStream

  54. def todoByte(value: Int): Unit

  55. def todoDouble(value: Double): Unit

  56. def todoFloat(value: Float): Unit

  57. def todoGeoTag(tag: Int, loc: Int, count: Int, offset: Int): Unit

  58. def todoInt(value: Int): Unit

  59. def todoLong(value: Long): Unit

  60. def todoShort(value: Int): Unit

  61. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  62. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  63. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  64. def write(): Unit

    Encodes the raster to GeoTIFF, and writes the data to the output stream.

    Encodes the raster to GeoTIFF, and writes the data to the output stream.

    This method does not return a result; the result is written into the output stream provided to Encoder's constructor. Many of the methods used by write mutate the object, and Encoder is not thread-safe, so it's important not to call this more than once.

  65. def writeByte(value: Int): Unit

  66. def writeByteArrayOutputStream(b: ByteArrayOutputStream): Unit

    Immediately write a byte array to the output stream.

  67. def writeDouble(value: Double): Unit

  68. def writeFloat(value: Float): Unit

  69. def writeInt(value: Int): Unit

  70. def writeLong(value: Long): Unit

  71. def writeShort(value: Int): Unit

  72. def writeString(tag: Int, s: String): Unit

  73. def writeTag(tag: Int, typ: Int, count: Int, value: Int): Unit

  74. def writeTagDouble(tag: Int, typ: Int, value: Double): Unit

  75. def [B](y: B): (Encoder, B)

    Implicit information
    This member is added by an implicit conversion from Encoder to ArrowAssoc[Encoder] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implict Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from Encoder to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (encoder: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from Encoder to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (encoder: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: Encoder

    Implicit information
    This member is added by an implicit conversion from Encoder to ArrowAssoc[Encoder] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (encoder: ArrowAssoc[Encoder]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: Encoder

    Implicit information
    This member is added by an implicit conversion from Encoder to Ensuring[Encoder] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (encoder: Ensuring[Encoder]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Encoder to StringAdd

Inherited by implicit conversion any2stringfmt from Encoder to StringFormat

Inherited by implicit conversion any2ArrowAssoc from Encoder to ArrowAssoc[Encoder]

Inherited by implicit conversion any2Ensuring from Encoder to Ensuring[Encoder]

Ungrouped