---
name: "pkinfo"
section: "1"
platform: "linux"
package: "pktools"
version: "2.6.7.6+ds-6+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pkinfo"
---

# pkinfo(1)

Report basic information from raster datasets

## NAME

pkinfo - Report basic information from raster datasets

## SYNOPSIS

FC**pkinfo**F\[0\]  FC**-i**F\[0\] *input* \[*options*\]

## DESCRIPTION

**pkinfo** retrieves basic information about a raster data set (similar to [**gdalinfo**(1)](/gdalinfo/1.md)). An important difference with **gdalinfo** is that **pkinfo** only reports the information that is requested via the corresponding command line option, whereas **gdalinfo** provides all basic information at once. The reported information is in a format that can be used as input for other pktools utilities. This mechanism facilitates command substitution in the bash scripting language.

## OPTIONS

- FC**-i**F\[0\] *filename*, FC**--input**F\[0\] *filename*

  Input image file

- FC**-bb**F\[0\], FC**--bbox**F\[0\]

  Shows bounding box

- FC**-te**F\[0\], FC**--te**F\[0\]

  Shows bounding box in GDAL format: xmin ymin xmax ymax

- FC**-c**F\[0\], FC**--center**F\[0\]

  Image center in projected X,Y coordinates

- FC**-ct**F\[0\], FC**--colortable**F\[0\]

  Shows colour table

- FC**-ns**F\[0\], FC**--nsample**F\[0\]

  Number of samples in image

- FC**-nl**F\[0\], FC**--nline**F\[0\]

  Number of lines in image

- FC**-nb**F\[0\], FC**--nband**F\[0\]

  Show number of bands in image

- FC**-b**F\[0\] *band*, FC**--band**F\[0\] *band*

  Band specific information

- FC**-dx**F\[0\], FC**--dx**F\[0\]

  Gets resolution in x (in m)

- FC**-dy**F\[0\], FC**--dy**F\[0\]

  Gets resolution in y (in m)

- FC**-mm**F\[0\], FC**--minmax**F\[0\]

  Shows min and max value of the image

- FC**-min**F\[0\], FC**--minimum**F\[0\]

  Shows min value of the image

- FC**-max**F\[0\], FC**--maximum**F\[0\]

  Shows max value of the image

- FC**-stats**F\[0\], FC**--statistics**F\[0\]

  Shows statistics (min,max, mean and stdDev of the image)

- FC**-a\_srs**F\[0\], FC**--a\_srs**F\[0\]

  Shows projection of the image

- FC**-geo**F\[0\], FC**--geo**F\[0\]

  Gets geotransform

- FC**-il**F\[0\], FC**--interleave**F\[0\]

  - FC**-f**F\[0\], FC**--filename**F\[0\]

  Shows image filename

- FC**-cover**F\[0\], FC**--cover**F\[0\]

  Print filename to STDOUT if current image covers the provided coordinates via bounding box, (x y) coordinates or extent of vector file

- FC**-x**F\[0\] *value*, FC**--xpos**F\[0\] *value*

  x pos

- FC**-y**F\[0\] *value*, FC**--ypos**F\[0\] *value*

  y pos

- FC**-r**F\[0\], FC**--read**F\[0\]

  Reads row y (in projected coordinates if geo option is set, otherwise in image coordinates, 0 based)

- FC**-ref**F\[0\], FC**--reference**F\[0\]

  Gets reference pixel (lower left corner of center of gravity pixel)

- FC**-of**F\[0\], FC**--oformat**F\[0\]

  Gets driver description

- FC**-e**F\[0\] *filename*, FC**--extent**F\[0\] *filename*

  Gets boundary from vector file

- FC**-ulx**F\[0\] *ULX*, FC**--ulx**F\[0\] *ULX*

  Upper left x value bounding box

- FC**-uly**F\[0\] *ULY*, FC**--uly**F\[0\] *ULY*

  Upper left y value bounding box

- FC**-lrx**F\[0\] *LRX*, FC**--lrx**F\[0\] *LRX*

  Lower right x value bounding box

- FC**-lry**F\[0\] *LRY*, FC**--lry**F\[0\] *LRY*

  Lower right y value bounding box

- FC**-ot**F\[0\], FC**--otype**F\[0\]

  - FC**-d**F\[0\], FC**--description**F\[0\]

  Returns image description

- FC**-meta**F\[0\], FC**--meta**F\[0\]

  Shows meta data

- FC**-nodata**F\[0\] *value*, FC**--nodata**F\[0\] *value*

  Sets no data value(s) for calculations (nodata values in input image)

## EXAMPLE

show number of bands in raster *image.tif*

```
FC
pkinfo -i image.tif -nb
      F[0]
```

show maximum value of band 1 (starting from 0) of raster *image.tif*

```
FC
pkinfo -i image.tif -max -b 1
      F[0]
```

read (dump) upper left pixel value for bands 3,2,1

```
FC
pkinfo -i image.tif -x 0 -y 0 -r -b 3 -b 2 -b 1
      F[0]
```

read (dump) pixel value at this geographic location (x,y) for bands 3,2,1

```
FC
pkinfo -i image.tif -x 3528120 -y 4329681 -geo -r -b 3 -b 2 -b 1
      F[0]
```

show bounding box (FC**-ulx**F\[0\] FC**-uly**F\[0\] FC**-lrx**F\[0\] FC**-lry**F\[0\]) in geo coordinates for *image1.tif*

```
FC
pkinfo -i image1.tif -b
      F[0]
```

show bounding box (FC**-ulx**F\[0\] FC**-uly**F\[0\]  FC**-lrx**F\[0\] FC**-lry**F\[0\]) in geo coordinates for each image (and union and intersect)

```
FC
pkinfo -i image1.tif -i image2.tif -i image3.tif -b
      F[0]
```

show the reference pixel (centre of gravity) for *image1.tif*, treating 0 and 255 as NO VALUE

```
FC
pkinfo -i image1.tif --mask 0 --mask 255 -ref
      F[0]
```

read (dump) pixel value at image centre for band 0

```
FC
pkinfo -i image.tif $(pkinfo -i image.tif -c) -geo -r
      F[0]
```

read (dump) pixel value in band 0 (default) for all images in current directory that cover this geographic location

```
FC
pkinfo $(for IMAGE in modis_2010*.tif; do pkinfo -i $IMAGE --cover -x 4215500 -y 2534000; done) -x 4215500 -y 253400
      F[0]
```

## SEE ALSO

[**gdalinfo**(1)](/gdalinfo/1.md)
