logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pkextractimg - extract pixel values from raster image using a raster sample

Description

pkextractimg extracts pixel values from an input raster dataset, based on the locations you provide via a
       sample  file.   The sample should be a raster dataset with categorical (integer) values.  The typical use
       case is a land cover map that overlaps the input raster dataset.  The utility then extracts  pixels  from
       the  input  raster for the respective land cover classes.  To select a random subset of the sample raster
       dataset you can set the threshold option -t with a percentage value.  You can provide a  threshold  value
       for  each class (e.g.  -t80-t60).  Use value 100 to select all pixels for selected class(es).  As out‐
       put, a new copy of the vector file is created with an extra attribute for the extracted pixel value.  For
       each raster band in the input image, a separate attribute  is  created.   For  instance,  if  the  raster
       dataset contains three bands, three attributes are created (b0, b1 and b2).

Name

       pkextractimg - extract pixel values from raster image using a raster sample

Options

-ifilename, --inputfilename
              Raster input dataset containing band information

       -ssample, --samplesample
              Raster  dataset  with  categorical values to sample the input raster dataset.  Output will contain
              features with input band information included.

       -lnlayer, --lnlayer
              Layer name(s) in sample (leave empty to select all)

       -randnumber, --randomnumber
              Create simple random sample of points.  Provide number of points to generate

       -gridsize, --gridsize
              Create systematic grid of points.  Provide cell grid size (in projected units, e.g,. m)

       -ofilename, --outputfilename
              Output sample dataset

       -cclass, --classclass
              Class(es) to extract from input sample image.  Leave empty to extract all valid data  pixels  from
              sample dataset.  Make sure to set classes if rule is set to mode, proportion or count.

       -tthreshold, --thresholdthreshold
              Probability threshold for selecting samples (randomly).  Provide probability in percentage (>0) or
              absolute  (<0).   Use a single threshold per vector sample layer.  If using raster land cover maps
              as a sample dataset, you can provide a threshold value for each class (e.g. -t80-t60).   Use
              value 100 to select all pixels for selected class(es)

       -fformat, --fformat
              Output sample dataset format

       -ftfieldType, --ftypefieldType
              Field type (only Real or Integer)

       -ltlabelType, --ltypelabelType
              Label type: In16 or String

       -bband, --bandband
              Band index(es) to extract.  Leave empty to use all bands

       -sbandband, --startbandband
              Start band sequence number

       -ebandband, --endbandband
              End band sequence number

       -bndnodataband, --bndnodataband
              Band(s) in input image to check if pixel is valid (used for srcnodata)

       -srcnodatavalue, --srcnodatavalue
              Invalid value(s) for input image

       -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.)

       -cnattribute, --cnameattribute
              Name of the class label in the output vector dataset

       -downvalue, --downvalue
              Down sampling factor

       -vlevel, --verboselevel
              Verbose mode if > 0

                                                 01 January 2025                                 pkextractimg(1)

Synopsis

pkextractimg-iinput [-ssample] -ooutput [options]

See Also