pkdumpimg(1)

πŸ’– pkdumpimg β€” the manual, but make it cute πŸ’–

okay bestie, so this is the pkdumpimg(1) page β€” it's literally the glow-up guide for dumping raster image content to ASCII or STDOUT. sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

pkdumpimg β€” a whole program whose job is dumping image content to ASCII or to STDOUT. that's it, that's the gig πŸ’…


🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so pkdumpimg dumps the content of a raster dataset to (standard) output β€” and by standard output we mean either your screen or a filename, your call boo. πŸ’–

the default vibe is dumping the output in matrix format. iconic. but if you use -of line, it dumps each pixel value on its own separate line, preceded by its position (the x and y value). one pixel per line, very main character energy.

you can also specify a bounding box to dump β€” either with the extent of an OGR vector dataset, or via the options -ulx, -uly, -lrx and -lry. yes girl, you get to choose your own rectangle πŸŽ€


πŸ’… OPTIONS πŸ’…

  • -i filename, --input filename β€” input image file. the one you're dumping, obvi πŸ–ΌοΈ
  • -o filename, --output filename β€” Output ASCII file (Default is empty: use STDOUT). so if you leave it empty it just screams directly into STDOUT 🌈
  • -of matrix|line, --oformat matrix|line β€” Output format (matrix form or list (x,y,z) form). Default is matrix form πŸ“‹
  • -b band, --band band β€” band index to crop. pick your band, periodt 🎢
  • -e vector, --extent vector β€” get boundary from extent from polygons in vector file πŸ—ΊοΈ
  • -ulx value, --ulx value β€” Upper left x value bounding box (in geocoordinates if georef is true)
  • -uly value, --uly value β€” Upper left y value bounding box (in geocoordinates if georef is true)
  • -lrx value, --lrx value β€” Lower left x value bounding box (in geocoordinates if georef is true)
  • -lry value, --lry value β€” Lower left y value bounding box (in geocoordinates if georef is true)
  • -v level, --verbose level β€” verbose (Default: 0). crank it up if you wanna hear everything πŸ”₯

⭐ Advanced options ⭐

  • -dx value, --dx value β€” Output resolution in x (in meter) (0.0: keep original resolution)
  • -dy value, --dy value β€” Output resolution in y (in meter) (0.0: keep original resolution)
  • -r resampling, --resampling-method resampling β€” Resampling method (near: nearest neighbour, bilinear: bi-linear interpolation). choose your fighter ✨
  • -srcnodata value, --srcnodata value β€” set no data value(s) for input image
  • -dstnodata value, --dstnodata value β€” nodata value for output if out of bounds.

πŸŽ€ EXAMPLE πŸŽ€

okay so we create a 5x5 raster dataset containing all 0 values except for its center (value=1). little baby raster, so cute 😭

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

like hello?? it just shows up on your screen. ate and left no crumbs πŸ‘‘


🌈 SEE ALSO 🌈

pkascii2img(1) β€” go read that one next bestie, they're a matching set πŸ’œ


that's the whole page, no cap. every flag, every default, every little georef caveat β€” all still here, just with better vibes ✨

and that's a wrap on the 01 January 2025 edition of pkdumpimg(1) β€” mwah, love u, go dump some rasters πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from