pkextractimg(1)
π pkextractimg π
okay bestie, welcome to pkextractimg β section 1 of the manual, the "general commands" girlies. this is the tool that pulls pixel values out of your raster using another raster as the map, and honestly? she ate. π
β¨ NAME β¨
pkextractimg β extract pixel values from a raster image using a raster sample π¦
πΈ SYNOPSIS πΈ
pkextractimg -i input [-s sample] -o output [options]
like, that's it. that's the whole vibe. π
π DESCRIPTION π
so here's the tea, bestie: pkextractimg pulls pixel values out of an input raster dataset, based on the locations you hand her via a sample file. she needs you to give her those locations, okay? she's not a mind reader. π
the sample should be a raster dataset with categorical (integer) values. the classic use case β the one everyone's obsessed with β is a land cover map that overlaps your input raster dataset. then the utility goes and extracts pixels from the input raster for the respective land cover classes. iconic behavior, no cap. β¨
want a random subset of the sample raster dataset instead of the whole thing? set the threshold option -t with a percentage value. and the way that you can even give a threshold value for each class (e.g. -t 80 -t 60)? yes ma'am, per-class thresholds, we love to see it. π
use value 100 to select all pixels for the selected class(es). periodt.
as output, a new copy of the vector file is created, with an extra attribute for the extracted pixel value. and for each raster band in the input image, a separate attribute is created. so, for instance β if the raster dataset contains three bands, then three attributes are created (b0, b1 and b2). math is math, bestie. π§
π OPTIONS π
-ifilename,--inputfilename β the raster input dataset containing band information. your main character. π-ssample,--samplesample β raster dataset with categorical values, used to sample the input raster dataset. the output will contain features with input band information included. π¦-lnlayer,--lnlayer β layer name(s) in the sample. leave it empty to select all of them, girl, go wild. πΈ-randnumber,--randomnumber β create a simple random sample of points. just provide the number of points to generate. π²-gridsize,--gridsize β create a systematic grid of points. provide the cell grid size, in projected units (e.g. m). so organized, so systematic. π-ofilename,--outputfilename β the output sample dataset. this is where the magic lands. β¨-cclass,--classclass β class(es) to extract from the input sample image. leave empty to extract all valid data pixels from the sample dataset. and bestie, listen: make sure to set classes if rule is set tomode,proportionorcount. that part is not optional. π-tthreshold,--thresholdthreshold β probability threshold for selecting samples (randomly). provide the probability in percentage (>0) or absolute (<0). use a single threshold per vector sample layer. if you're using raster land cover maps as a sample dataset, you can provide a threshold value for each class (e.g.-t 80 -t 60). use value100to select all pixels for the selected class(es). π―-fformat,--fformat β the output sample dataset format. π-ftfieldType,--ftypefieldType β field type. and it's giving... onlyRealorInteger, those are your two options. π-ltlabelType,--ltypelabelType β label type:In16orString. pick your fighter. π¦-bband,--bandband β band index(es) to extract. leave empty to use all bands. all of them. every single one. π-sbandband,--startbandband β start band sequence number. β-ebandband,--endbandband β end band sequence number. π-bndnodataband,--bndnodataband β band(s) in the input image to check if a pixel is valid (used forsrcnodata). the vibe check, basically. β-srcnodatavalue,--srcnodatavalue β invalid value(s) for the input image. the ones we don't claim. π-bnattribute,--bnameattribute β for single band input data, this extra attribute name will correspond to the raster values. for multi-band input data, multiple attributes with this prefix will be added (e.g.b0,b1,b2, etc.). so many babies. πΌ-cnattribute,--cnameattribute β name of the class label in the output vector dataset. π·οΈ-downvalue,--downvalue β down sampling factor. π-vlevel,--verboselevel β verbose mode if> 0. she will simply not stop talking and honestly? we support her. π£οΈ
π quick reminder, bestie: that's every flag, every default, every value. don't skip any of them or the pixels will simply not be extracted and we'll all be sad. π«Ά
and that's the whole page, my love π this was pkextractimg from the pkextractimg(1) manual, sourced and versioned as 01 January 2025, so go forth, extract those pixels, and slay the day away. mwah. πβ¨ππ¦πΈπ
ππβ
π¦ 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