Processing Kernel for remote sensing data
|
perform raster data operations on image such as crop, extract and stack bands
Usage: pkcrop -i input -o output
Options: [-of out_format] [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/CInt16/CInt32/CFloat32/CFloat64}] [-b band]* [-ulx ULX -uly ULY -lrx LRX -lry LRY] [-dx xres] [-dy yres] [-r resampling_method] [-a_srs epsg:number] [-dstnodata value]
Advanced options: [-e vector [-m]] [-co NAME=VALUE]* [-x center_x -y center_y] [-nx size_x -ny size_y] [-ns nsample -nl nlines] [-as min -as max] [-s scale]* [-off offset]* [-ct colortable] [-d description]
The utility pkcrop can subset and stack raster images. In the spatial domain it can crop a bounding box from a larger image. The output bounding box is selected by setting the new corner coordinates using the options -ulx -uly -lrx -lry. Alternatively you can set the new image center (-x -y) and size. This can be done either in projected coordinates (using the options -nx -ny) or in image coordinates (using the options -ns -nl). You can also use a vector file to set the new bounding box (option -e). In the spectral domain, pkcrop allows you to select individual bands from one or more input image(s). Bands are stored in the same order as provided on the command line, using the option -b. Band numbers start with index 0 (indicating the first band). The default is to select all input bands. If more input images are provided, the bands are stacked into a multi-band image. If the bounding boxes or spatial resolution are not identical for all input images, you should explicitly set them via the options. The pkcrop utility is not suitable to mosaic or composite images. Consider the utility pkcomposite instead.
-short
or --long
options (both --long=value
and --long value
are supported)-h
shows basic options only, long option --help
shows all options short | long | type | default | description |
---|---|---|---|---|
i | input | std::string | Input image file(s). If input contains multiple images, a multi-band output is created | |
o | output | std::string | Output image file | |
a_srs | a_srs | std::string | Override the projection for the output file (leave blank to copy from input file, use epsg:3035 to use European projection and force to European grid | |
ulx | ulx | double | 0 | Upper left x value bounding box |
uly | uly | double | 0 | Upper left y value bounding box |
lrx | lrx | double | 0 | Lower right x value bounding box |
lry | lry | double | 0 | Lower right y value bounding box |
b | band | int | band index to crop (leave empty to retain all bands) | |
as | autoscale | double | scale output to min and max, e.g., –autoscale 0 –autoscale 255 | |
ot | otype | std::string | Data type for output image ({Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/CInt16/CInt32/CFloat32/CFloat64}). Empty string: inherit type from input image | |
of | oformat | std::string | Output image format (see also gdal_translate). Empty string: inherit from input image | |
ct | ct | std::string | color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid) | |
dx | dx | double | Output resolution in x (in meter) (empty: keep original resolution) | |
dy | dy | double | Output resolution in y (in meter) (empty: keep original resolution) | |
r | resampling-method | std::string | near | Resampling method (near: nearest neighbor, bilinear: bi-linear interpolation). |
e | extent | std::string | get boundary from extent from polygons in vector file | |
m | mask | bool | false | mask values out of polygon in extent file to flag option (tip: for better performance, use gdal_rasterize -i -burn 0 -l extent extent.shp output (with output the result of pkcrop) |
co | co | std::string | Creation option for output file. Multiple options can be specified. | |
x | x | double | x-coordinate of image center to crop (in meter) | |
y | y | double | y-coordinate of image center to crop (in meter) | |
nx | nx | double | image size in x to crop (in meter) | |
ny | ny | double | image size in y to crop (in meter) | |
ns | ns | int | number of samples to crop (in pixels) | |
nl | nl | int | number of lines to crop (in pixels) | |
s | scale | double | output=scale*input+offset | |
off | offset | double | output=scale*input+offset | |
nodata | nodata | double | Nodata value to put in image if out of bounds. | |
d | description | std::string | Set image description |
Some examples how to use pkcrop can be found here