pkinfo(1)
πΈ NAME πΈ
okay so welcome to the pkinfo(1) manual page bestie π and here's the tea: pkinfo is your girl for reporting basic information from raster datasets. that's it, that's the whole job, and she does it flawlessly. periodt.
β¨ SYNOPSIS β¨
pkinfo -i input [options]
π¦ DESCRIPTION π¦
so pkinfo pulls up basic information about a raster data set, kinda like what gdalinfo(1) does π but here's the plot twist, and it's a big one: the way pkinfo differs from gdalinfo is that pkinfo only reports the info you actually ask for with the matching command line option, whereas gdalinfo just dumps every single basic fact at you all at once. no chill, no filter, all of it. pkinfo would never π
and the way she formats that info? it's in a format you can feed straight back in as input to other pktools utilities π«Ά which means you can do command substitution in the bash scripting language and it just works. iconic behavior honestly.
π OPTIONS π
-i filename,--input filenameβ the input image file, aka the whole reason we're here π-bb,--bboxβ shows the bounding box-te,--teβ shows the bounding box in GDAL format:xmin ymin xmax ymax-c,--centerβ the image center in projected X,Y coordinates-ct,--colortableβ shows the colour table-ns,--nsampleβ how many samples are in the image-nl,--nlineβ how many lines are in the image-nb,--nbandβ shows how many bands are in the image-b band,--band bandβ band specific information π-dx,--dxβ gets the resolution in x (in m)-dy,--dyβ gets the resolution in y (in m)-mm,--minmaxβ shows the min and max value of the image-min,--minimumβ shows the min value of the image-max,--maximumβ shows the max value of the image-stats,--statisticsβ shows statistics, specifically(min,max, mean and stdDev of the image)-a_srs,--a_srsβ shows the projection of the image-geo,--geoβ gets the geotransform-il,--interleaveβ no description in the source bestie, she's just out here living her truth π-f,--filenameβ shows the image filename-cover,--coverβ prints the filename toSTDOUTif the current image covers the coordinates you provided, either via bounding box,(x y)coordinates, or the extent of a vector file-x value,--xpos valueβ x pos-y value,--ypos valueβ y pos-r,--readβ reads row y (in projected coordinates if the geo option is set, otherwise in image coordinates, 0 based)-ref,--referenceβ gets the reference pixel (lower left corner of center of gravity pixel)-of,--oformatβ gets the driver description-e filename,--extent filenameβ gets the boundary from a vector file-ulx ULX,--ulx ULXβ upper left x value bounding box-uly ULY,--uly ULYβ upper left y value bounding box-lrx LRX,--lrx LRXβ lower right x value bounding box-lry LRY,--lry LRYβ lower right y value bounding box-ot,--otypeβ also no description in the source, she's mysterious like that π-d,--descriptionβ returns the image description-meta,--metaβ shows meta data-nodata value,--nodata valueβ sets the no data value(s) for calculations (the nodata values in the input image)
π EXAMPLE π
show the number of bands in the raster image.tif:
pkinfo -i image.tif -nb
show the maximum value of band 1 (starting from 0) of the raster image.tif:
pkinfo -i image.tif -max -b 1
read (dump) the upper left pixel value for bands 3,2,1:
pkinfo -i image.tif -x 0 -y 0 -r -b 3 -b 2 -b 1
read (dump) the pixel value at this geographic location (x,y) for bands 3,2,1:
pkinfo -i image.tif -x 3528120 -y 4329681 -geo -r -b 3 -b 2 -b 1
show the bounding box (-ulx -uly -lrx -lry) in geo coordinates for image1.tif:
pkinfo -i image1.tif -b
show the bounding box (-ulx -uly -lrx -lry) in geo coordinates for each image (and union and intersect):
pkinfo -i image1.tif -i image2.tif -i image3.tif -b
show the reference pixel (centre of gravity) for image1.tif, treating 0 and 255 as NO VALUE:
pkinfo -i image1.tif --mask 0 --mask 255 -ref
read (dump) the pixel value at the image centre for band 0:
pkinfo -i image.tif $(pkinfo -i image.tif -c) -geo -r
read (dump) the pixel value in band 0 (the default) for all images in the current directory that cover this geographic location:
pkinfo $(for IMAGE in modis_2010*.tif; do pkinfo -i $IMAGE --cover -x 4215500 -y 2534000; done) -x 4215500 -y 253400
π«Ά SEE ALSO π«Ά
gdalinfo(1) β the loud one who says everything at once π
and that's the whole page bestie, you ate it up π go forth and interrogate some rasters π
okay so this was pkinfo(1), dated 01 January 2025 β love her, she's timeless β¨ππΈ
π¦ where this page comes from
- ubuntu questing: pktools 2.6.7.6+ds-6build4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms