pkdsm2shadow(1)

✨ pkdsm2shadow β€” bestie's guide to casting shade (literally) ✨

okay so picture this: you've got a digital surface model and you wanna know where the sun isn't shining. that's the whole vibe here. this is pkdsm2shadow, a program to calculate sun shadow based on digital surface model and sun angles. no cap. πŸ’…


🌸 SYNOPSIS 🌸

pkdsm2shadow -i input -o output [-sza angle] [-saa angle] [options]
             [advanced options]

πŸ¦‹ DESCRIPTION πŸ¦‹

pkdsm2shadow is a utility to create a binary shadow mask from a digital surface model, based on Sun zenith (-sza) and azimuth angles (-saa). that's it, that's the girl. you give her a surface, you tell her where the sun is, she tells you what's in shadow. iconic behavior fr fr. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -i filename, --input filename β€” input image file. the one you're reading from, bestie. πŸ“₯
  • -o filename, --output filename β€” Output image file. where the shadow mask goes. πŸ“€
  • -sza angle, --sza angle β€” Sun zenith angle. how high up the sun is, angle-wise. β˜€οΈ
  • -saa angle, --saa angle β€” Sun azimuth angle, and yes the directions are written out for you because we love clarity: N=0 E=90 S=180 W=270. 🧭
  • -f value, --flag value β€” Flag to put in image if pixel shadow. this is the value a shadowed pixel gets stamped with. 🏷️
  • -ot type, --otype type β€” Data type for output image. your choices are: {Byte / Int16 / UInt16 / UInt32 / Int32 / Float32 / Float64 / CInt16 / CInt32 / CFloat32 / CFloat64}. and here's the cute part: an empty string means inherit type from input image. matching energy. πŸ’–
  • -of GDALformat, --oformat GDALformat β€” Output image format (see also gdal_translate(1)). πŸ‘€
  • -ct filename, --ct filename β€” color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid)). so yes, alpha goes from see-through to fully opaque, we love a range. 🌈
  • -co option, --co option β€” Creation option for output file. Multiple options can be specified. stack 'em, girl. πŸŽ€
  • -v level, --verbose level β€” verbose mode if > 0. want her to yap about what she's doing? bump the level. πŸ—£οΈ

⭐ Advanced options ⭐

these are the extra-credit ones, iykyk.

  • -s value, --scale value β€” scale used for input dsm: height=scale*input+offset πŸ“
  • -off value, --offset value β€” offset used for input dsm: height=scale*input+offset πŸ“

πŸ”₯ EXAMPLE πŸ”₯

Create a shadow mask for the input raster dataset dsm.tif, 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.

pkdsm2shadow -i dsm.tif -sza 10 -saa 170 -f 1 -o shadow.tif
ok so real talk: the prose up there says azimuth 135 (South-South-East) but the command itself says -saa 170. that's exactly how the original page has it, so i'm not touching it β€” just giving you the heads up so you're not out here thinking you misread. πŸ’€

and that's the whole page, bestie. this one's from pkdsm2shadow(1), dated 01 January 2025. go forth and cast some shade. πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from