DOKK / manpages / debian 11 / pktools / pkdumpimg.1.en
pkdumpimg(1) pkdumpimg(1)

pkdumpimg - program to dump image content to ASCII or STDOUT


pkdumpimg
-i input [-o output] [options] [advanced options]

pkdumpimg dumps the content of a raster dataset to (standard) output (screen or filename). The default is to dump the output in matrix format. Use -of line to dump each pixel value on a separate line, preceded by its position (x and y value). You can specify a bounding box to dump with either the extent of an OGR vector dataset or via the options -ulx -uly -lrx and -lry.

input image file
Output ASCII file (Default is empty: use STDOUT)
Output format (matrix form or list (x,y,z) form). Default is matrix form
band index to crop
get boundary from extent from polygons in vector file
Upper left x value bounding box (in geocoordinates if georef is true)
Upper left y value bounding box (in geocoordinates if georef is true)
Lower left x value bounding box (in geocoordinates if georef is true)
Lower left y value bounding box (in geocoordinates if georef is true)
verbose (Default: 0)

Advanced options

Output resolution in x (in meter) (0.0: keep original resolution)
Output resolution in y (in meter) (0.0: keep original resolution)
Resampling method (near: nearest neighbour, bilinear: bi-linear interpolation).
set no data value(s) for input image
nodata value for output if out of bounds.

We create a 5x5 raster dataset containing all 0 values except for its center (value=1)

cat input.txt
0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0

Use pkascii2img(1) to create an raster dataset from input.txt

pkascii2img -i input.txt -o output.tif -of GTiff -a_srs epsg:3035 -dx 25 -dy 25 -ulx 1000000 -uly 1000000

Dump the image content of output.tif to screen

pkdumpimg -i output.tif

pkascii2img(1)

06 December 2020