EnglishFrenchSpanish

OnWorks favicon

pkcomposite - Online in the Cloud

Run pkcomposite in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command pkcomposite that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


pkcomposite - program to mosaic and composite geo-referenced images

SYNOPSIS


pkcomposite -i input [-i input] -o output [options] [advanced options]

DESCRIPTION


pkcomposite can be used to {mosaic} and {composite} multiple (georeferenced) raster
datasets. A mosaic can merge images with different geographical extents into a single
larger image. Compositing resolves the overlapping pixels according to some rule (e.g,
the median of all overlapping pixels). This utility is complementary to GDAL, which
currently does not support a composite step. Input datasets can have different bounding
boxes and spatial resolutions.

Example: Calculate the maximum NDVI composite of two multispectral input images (e.g., red
is band 0 and near infrared is band 1)

pkcomposite -i input1.tif -i input2.tif -o output.tif -cr maxndvi -cb 0 -cb 1

Example: Calculate the minimum nadir composite of two input images, where the forth band
(b=3) contains the view zenith angle

pkcomposite -i input1.tif -i input2.tif -o minzenith.tif -cr minband -cb 3

Example: Calculate the minimum of two input images in all bands

pkcomposite -i input1.tif -i input2.tif -o minimum.tif -cr minallbands

OPTIONS


-i filename, --input filename
Input image file(s). If input contains multiple images, a multi-band output is
created

-o filename, --output filename
Output image file

-b band, --band band
band index(es) to crop (leave empty if all bands must be retained)

-dx xres, --dx xres
Output resolution in x (in meter) (empty: keep original resolution)

-dy yres, --dy yres
Output resolution in y (in meter) (empty: keep original resolution)

-e vector, --extent vector
get boundary from extent from polygons in vector file

-ulx ULX, --ulx ULX
Upper left x value bounding box

-uly ULY, --uly ULY
Upper left y value bounding box

-lrx LRX, --lrx LRX
Lower right x value bounding box

-lry LRY, --lry LRY
Lower right y value bounding box

-cr rule, --crule rule
Composite rule (overwrite, maxndvi, maxband, minband, mean, mode (only for byte
images), median, sum

-cb band, --cb band
band index used for the composite rule (e.g., for ndvi, use --cband=0 --cband=1
with 0 and 1 indices for red and nir band respectively

-srcnodata value, --srcnodata value
invalid value for input image

-bndnodata band, --bndnodata band
Bands in input image to check if pixel is valid (used for srcnodata, min and max
options)

-min value, --min value
flag values smaller or equal to this value as invalid.

-max value, --max value
flag values larger or equal to this value as invalid.

-dstnodata value, --dstnodata value
nodata value to put in output image if not valid or out of bounds.

-r resampling_method, --resampling-method resampling_method
Resampling method (near: nearest neighbor, bilinear: bi-linear interpolation).

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

-of GDALformat, --oformat GDALformat
Output image format (see also gdal_translate(1)). Empty string: inherit from input
image

-co NAME=VALUE, --co NAME=VALUE
Creation option for output file. Multiple options can be specified.

-a_srs EPSG:number, --a_srs EPSG:number
Override the spatial reference for the output file (leave blank to copy from input
file, use epsg:3035 to use European projection and force to European grid)

-v, --verbose
verbose

Advanced options

-file, --file
write number of observations (1) or sequence nr of selected file (2) for each
pixels as additional layer in composite. Default: 0

-w weight, --weight weight
Weights (type: short) for the composite, use one weight for each input file in same
order as input files are provided). Use value 1 for equal weights.

-c name, --class name
classes for multi-band output image: each band represents the number of
observations for one specific class. Use value 0 for no multi-band output image.

-ct filename, --ct filename
colour table in ASCII format having 5 columns: id R G B ALFA (0: transparent, 255:
solid)

-align, --align
Align output bounding box to first input image

-d description, --description description
Set image description

EXAMPLE


Create a composit from two input images. If images overlap, keep only last image (default
rule)

pkcomposite -i input1.tif -i input2.tif -o output.tif

Create a composit from two input images. Values of 255 in band 1 (starting from 0) are
masked as invalid. Typically used when second band of input image is a cloud mask

pkcomposite -i input1.tif -i input2.tif -srcnodata 255 -bndnodata 1 -dstnodata 0 -o output.tif

Create a maximum NDVI (normalized difference vegetation index) composit. Values of 255 in
band 0 are masked as invalid and flagged as 0 if no other valid coverage. Typically used
for (e.g., MODIS) images where red and near infrared spectral bands are stored in bands 0
and 1 respectively. In this particular case, a value of 255 in the first input band
indicates a nodata value (e.g., cloud mask is coded within the data values).

pkcomposite -i input1.tif -i input2.tif -cr maxndvi -rb 0 -rb 1 -srcnodata 255 -bndnodata 0 -dstnodata 0 -o output.tif

Create a composite image using weighted mean:
output=(3/4*input1+6/4*input2+3/4*input2)/3.0

pkcomposite -i input1.tif -i input2.tif -i input3.tif -o output.tif -cr mean -w 0.75 -w 1.5 -w 0.75

Create a median composit of all GTiff images found in current directory that cover (at
least part of) the image coverage.tif. Values smaller or equal to 0 are set as nodata 0
(default value for -dstnodata)

pkcomposite -i large.tif $(for IMAGE in *.tif;do pkinfo -i $IMAGE --cover $(pkinfo -i coverage.tif -bb);done) -cr median -min 0 -o output.tif

FAQ


Q1. First question

A1. For individual invalid value(s) in input image, use -srcnodata

Usage: use unique value for each invalid bands set in --bndnodata or use a single value
that will be applied to all invalid bands

Example:

pkcomposite -i input1.tif -i input2.tif -o output.tif -srcnodata 0 -srcnodata 255 -bndnodata 0 -bndnodata 1

will consider 0 in band 0 and 255 in band 1 of input images as no value

pkcomposite -i input1.tif -i input2.tif -o output.tif -srcnodata 0 -bndnodata 0 -bndnodata 1

will consider 0 in both bands 0 and 1 of input images as no value

For range(s) of invalid values in input images: use -min (--min) and -max (--max) Usage:
use unique range set for each invalid bands set in -bndnodata

Example:

pkcomposite -i input1.tif -i input2.tif -o output.tif -min 0 -max 200 -min 0 -max 2 -bndnodata 0 -bndnodata 1

will consider all negative values in band 0 and 1 of input images as invalid. Values
larger or equal to 200 in band 0 will be invalid, as well as values larger or equal to 2
in band 1

Q2. If I take the mean value as composit rule for multi-band input images, will the output
image contain the mean value of overlapping images in each band?

A2. Yes

24 January 2016 pkcomposite(1)

Use pkcomposite online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Avogadro
    Avogadro
    Avogadro is an advanced molecular
    editor designed for cross-platform use
    in computational chemistry, molecular
    modeling, bioinformatics, materials
    science and ...
    Download Avogadro
  • 2
    XMLTV
    XMLTV
    XMLTV is a set of programs to process
    TV (tvguide) listings and help manage
    your TV viewing, storing listings in an
    XML-based format. There are utilities to
    do...
    Download XMLTV
  • 3
    strikr
    strikr
    Strikr Free Software project. Artifacts
    released under a 'intent based'
    dual license: AGPLv3 (community) and
    CC-BY-NC-ND 4.0 international
    (commercial)...
    Download strikr
  • 5
    GIFLIB
    GIFLIB
    giflib is a library for reading and
    writing gif images. It is API and ABI
    compatible with libungif which was in
    wide use while the LZW compression
    algorithm was...
    Download GIFLIB
  • 6
    Alt-F
    Alt-F
    Alt-F provides a free and open source
    alternative firmware for the DLINK
    DNS-320/320L/321/323/325/327L and
    DNR-322L. Alt-F has Samba and NFS;
    supports ext2/3/4...
    Download Alt-F
  • More »

Linux commands

  • 1
    4s-queryJ
    4s-queryJ
    4s-query � Run SPARQL queries on a
    4store storage backend ...
    Run 4s-queryJ
  • 2
    4ti2-circuits
    4ti2-circuits
    4ti2 - software package for algebraic,
    geometric and combinatorial problems on
    linear spaces ...
    Run 4ti2-circuits
  • 3
    cpufreq-set
    cpufreq-set
    cpufreq-set - A small tool which allows
    to modify cpufreq settings. SYNTAX:
    cpufreq-set [options] DESCRIPTION:
    cpufreq-set allows you to modify cpufreq
    setting...
    Run cpufreq-set
  • 4
    cpufreqd-get
    cpufreqd-get
    cpufreqd-get - Issues "get" commands to
    cpufreqd. SYNTAX: cpufreqd-get [-l]
    PARAMETERS: -l list applied Profiles for
    all cpus. DESCRIPTION: cpufreqd-get
    issues...
    Run cpufreqd-get
  • 5
    gammu
    gammu
    gammu - Does some neat things with your
    cellular phone or modem. ...
    Run gammu
  • 6
    ganglia2pcp
    ganglia2pcp
    ganglia2pcp - import ganglia data and
    create a PCP archive ...
    Run ganglia2pcp
  • More »

Ad