Module Gdal.Band

Raster Bands

type c
type ('v, 'e) t = c * ('v'e) Bigarray.kind
val t : c Ctypes.typ
val to_ba_kind : ('v'et ‑> ('v'e) Bigarray.kind

to_ba_kind t returns the Bigarray.kind matching t.

module Data : sig ... end
exception IO_error
exception Invalid_dimensions
val get_size : (__t ‑> int * int

get_size t returns the (x, y) dimensions in pixels.

val get_data_type : c ‑> [ `byte | `uint16 | `int16 | `uint32 | `int32 | `float32 | `float64 | `unknown | `unhandled ]

get_data_type t returns the data type of the given raster band.

val get_band_number : (__t ‑> int option

get_band_number t returns the index of t in its dataset or None if the index is unknown.

val read : ?⁠offset:(int * int) ‑> ?⁠size:(int * int) ‑> ?⁠pixel_spacing:int ‑> ?⁠line_spacing:int ‑> ?⁠buffer_size:(int * int) ‑> (__t ‑> ('v'eData.t ‑> ('v'e, Bigarray.c_layout) Bigarray.Array2.t

read t kind reads the values from t as kind values.

val write : ?⁠offset:(int * int) ‑> ?⁠size:(int * int) ‑> ?⁠pixel_spacing:int ‑> ?⁠line_spacing:int ‑> (__t ‑> ('v'eData.t ‑> ('v'e, Bigarray.c_layout) Bigarray.Array2.t ‑> unit

write t kind data writes the values from t as kind values.

val fill : ?⁠imaginary:float ‑> (__t ‑> float ‑> unit

file ?imaginary t real sets all values in t to real. If t holds complex numbers then imaginary can be specified as well.

val get_description : (__t ‑> string

get_description t returns the description of the current band. If no description exists then the returned string will be empty.

val get_no_data_value : (__t ‑> float option

get_no_data_value t returns the value representing no/missing data in band t, or None if no such value is set.

val set_description : (__t ‑> string ‑> unit

set_description t desc sets the description of t to desc.

val set_no_data_value : (__t ‑> float ‑> unit

set_no_data_value t x defines x as representing no/missing data in band t.

val iter : ('v_t ‑> (int ‑> int ‑> 'v ‑> 'v) ‑> unit

iter t f applies f to every value in t then assigns the result back to the same point in t.

val iter_read : ('v_t ‑> (int ‑> int ‑> 'v ‑> unit) ‑> unit

iter_read t f calls f with every value in t.

val iter_write : ('v_t ‑> (int ‑> int ‑> 'v) ‑> unit

iter_write t f calls f with every pixel offset in t. The result of f is written back to t at the current offset.

val itera : ('v1_t array ‑> ('v2_t ‑> (int ‑> int ‑> 'v1 array ‑> 'v2 ‑> 'v2) ‑> unit

itera src dst f acts like iter except that it applies f to matching pixels in each raster in src and dst, writing the result of f back to dst. All bands in src and dst must have the same overall dimensions and the same block size.

val itera_read : ('v1_t array ‑> ('v2_t ‑> (int ‑> int ‑> 'v1 array ‑> 'v2 ‑> unit) ‑> unit

itera_read src dst f is like itera except that no values are written back to dst.

val itera_write : ('v1_t array ‑> ('v2_t ‑> (int ‑> int ‑> 'v1 array ‑> 'v2) ‑> unit

itera_write t f is like itera except that no values are read from dst.

val fold : ('v_t ‑> (int ‑> int ‑> 'v ‑> 'accu ‑> 'accu) ‑> 'accu ‑> 'accu

fold t f init folds over the pixels in t with f.

val copy : ?⁠options:string list ‑> src:(__t ‑> dst:(__t ‑> unit

copy ?options ~src ~dst copies the contents of src to dst. GDAL will perform any data conversion necessary.

module Block : sig ... end