gdal.RasterBandPixels
A representation of a RasterBand's pixels.
Note: Typed arrays should be created with an external ArrayBuffer for versions of node >= 0.11
var n = 16*16;
var data = new Float32Array(new ArrayBuffer(n*4));
//read data into the existing array
band.pixels.read(0,0,16,16,data);`
Table of Contents
Methods
get
-
x
-
y
Returns the value at the x, y coordinate.
Parameters:
-
x
Integer -
y
Integer
Returns:
read
-
x
-
y
-
width
-
height
-
data] The [TypedArray
-
options
Reads a region of pixels.
Parameters:
-
x
Integer -
y
Integer -
width
Integer -
height
Integer -
[data] The [TypedArray]
TypedArray optional(https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView#Typed_array_subclasses) to put the data in. A new array is created if not given.
-
[options]
Object optional-
[buffer_width=x_size]
Integer optional -
[buffer_height=y_size]
Integer optional -
[data_type]
String optionalSee GDT constants.
-
[pixel_space]
Integer optional -
[line_space]
Integer optional
-
Returns:
A TypedArray of values.
readBlock
-
x
-
y
-
data] The [TypedArray
Reads a block of pixels.
Parameters:
-
x
Integer -
y
Integer -
[data] The [TypedArray]
TypedArray optional(https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView#Typed_array_subclasses) to put the data in. A new array is created if not given.
Returns:
A TypedArray of values.
set
-
x
-
y
-
value
Sets the value at the x, y coordinate.
Parameters:
-
x
Integer -
y
Integer -
value
Number
write
-
x
-
y
-
width
-
height
-
data
-
options
Writes a region of pixels.
Parameters:
-
x
Integer -
y
Integer -
width
Integer -
height
Integer -
data
TypedArrayThe TypedArray to write to the band.
-
[options]
Object optional-
[buffer_width=x_size]
Integer optional -
[buffer_height=y_size]
Integer optional -
[pixel_space]
Integer optional -
[line_space]
Integer optional
-
writeBlock
-
x
-
y
-
data
Writes a block of pixels.
Parameters:
-
x
Integer -
y
Integer -
data
TypedArrayThe TypedArray of values to write to the band.