---
name: "pkdsm2shadow"
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/pkdsm2shadow"
---

# pkdsm2shadow(1)

program to calculate sun shadow based on digital surface model and sun angles

## NAME

pkdsm2shadow - program to calculate sun shadow based on digital surface model and sun angles

## SYNOPSIS

FC**pkdsm2shadow**F\[0\]  FC**-i**F\[0\] *input* FC**-o**F\[0\] *output* \[FC**-sza**F\[0\] *angle*\] \[FC**-saa**F\[0\] *angle*\] \[*options*\] \[*advanced options*\]

## DESCRIPTION

**pkdsm2shadow** is a utility to create a binary shadow mask from a digital surface model, based on Sun zenith (FC**-sza**F\[0\]) and azimuth angles (FC**-saa**F\[0\]).

## OPTIONS

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

  input image file

- FC**-o**F\[0\] *filename*, FC**--output**F\[0\] *filename*

  Output image file

- FC**-sza**F\[0\] *angle*, FC**--sza**F\[0\] *angle*

  Sun zenith angle.

- FC**-saa**F\[0\] *angle*, FC**--saa**F\[0\] *angle*

  Sun azimuth angle (N=0 E=90 S=180 W=270).

- FC**-f**F\[0\] *value*, FC**--flag**F\[0\] *value*

  Flag to put in image if pixel shadow

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

  Data type for output image ({Byte / Int16 / UInt16 / UInt32 / Int32 / Float32 / Float64 / CInt16 / CInt32 / CFloat32 / CFloat64}). Empty string: inherit type from input image

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

  Output image format (see also [**gdal\_translate**(1)](/gdal_translate/1.md)).

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

  color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid)

- FC**-co**F\[0\] *option*, FC**--co**F\[0\] *option*

  Creation option for output file. Multiple options can be specified.

- FC**-v**F\[0\] *level*, FC**--verbose**F\[0\] *level*

  verbose mode if \> 0

Advanced options

- FC**-s**F\[0\] *value*, FC**--scale**F\[0\] *value*

  scale used for input dsm: height=scale\*input+offset

- FC**-off**F\[0\] *value*, FC**--offset**F\[0\] *value*

  offset used for input dsm: height=scale\*input+offset

## EXAMPLE

Create a shadow mask for the input raster dataset FC*dsm.tif*F\[0\], using Sun zenith angle of 10 degrees and a Sun azimuth angle of 135 degrees (South-South-East). All shadow pixels are set to a value of 1.

```
FC
pkdsm2shadow -i dsm.tif -sza 10 -saa 170 -f 1 -o shadow.tif
      F[0]
```
