This is an automated email from the git hooks/post-receive script. sebastic-guest pushed a commit to branch upstream-master in repository pktools.
commit 3a70b0f1a2dfc6e424ccdd3fe055283adb49ab5c Author: Pieter Kempeneers <kempe...@gmail.com> Date: Sat Nov 8 20:12:16 2014 +0100 working on documentation --- doc/examples_pkascii2ogr.dox | 4 +++- doc/examples_pkcomposite.dox | 16 +++++++++++----- doc/examples_pkcreatect.dox | 24 +++++++++++++++++++----- doc/examples_pkcrop.dox | 10 +++++++--- doc/examples_pkextract.dox | 6 ++++++ doc/examples_pksvm.dox | 8 ++++---- 6 files changed, 50 insertions(+), 18 deletions(-) diff --git a/doc/examples_pkascii2ogr.dox b/doc/examples_pkascii2ogr.dox index e271f14..92a2ac9 100644 --- a/doc/examples_pkascii2ogr.dox +++ b/doc/examples_pkascii2ogr.dox @@ -1,5 +1,7 @@ \section examples_pkascii2ogr Examples of pkascii2ogr + +Create a vector shape file (output.shp) from input ASCII file (input.txt). The coordinates x (longitude) and y (latitude) can be found in input.txt as columns 3 and 2 respectively (columns start counting from 0). The remaining 2 columns in input.txt are used as fields (attributes) of type integer: id (column 0) and label (column 3). The projection is set to lat lon (epsg:4326). + \code pkascii2ogr -i input.txt -o output.shp -x 2 -y 1 -n id -ot Integer -n label -ot Integer -a_srs epsg:4326 \endcode -create a vector shape file (output.shp) from input ASCII file (input.txt). The coordinates x (longitude) and y (latitude) can be found in input.txt as columns 3 and 2 respectively (columns start counting from 0). The remaining 2 columns in input.txt are used as fields (attributes) of type integer: id (column 0) and label (column 3). The projection is set to lat lon (epsg:4326). diff --git a/doc/examples_pkcomposite.dox b/doc/examples_pkcomposite.dox index 55a0ceb..b070ffc 100644 --- a/doc/examples_pkcomposite.dox +++ b/doc/examples_pkcomposite.dox @@ -1,26 +1,32 @@ \section examples_pkcomposite Examples of pkcomposite + +Create a composit from two input images. If images overlap, keep only last image (default rule) + \code pkcomposite -i input1.tif -i input2.tif -o output.tif \endcode -create composit from two input images. If images overlap, keep only last image (default rule) + +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 \code pkcomposite -i input1.tif -i input2.tif -srcnodata 255 -bndnodata 1 -dstnodata 0 -o output.tif \endcode -create 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 + +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). \code pkcomposite -i input1.tif -i input2.tif -cr maxndvi -rb 0 -rb 1 -srcnodata 255 -bndnodata 0 -dstnodata 0 -o output.tif \endcode -create 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). + +Create a composite image using weighted mean: output=(3/4*input1+6/4*input2+3/4*input2)/3.0 \code pkcomposite -i input1.tif -i input2.tif -i input3.tif -o output.tif -cr mean -w 0.75 -w 1.5 -w 0.75 \endcode -create composite image using weighted mean: output=(3/4*input1+6/4*input2+3/4*input2)/3.0 + +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) \code 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 \endcode -create 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) diff --git a/doc/examples_pkcreatect.dox b/doc/examples_pkcreatect.dox index 4206533..24c9aa4 100644 --- a/doc/examples_pkcreatect.dox +++ b/doc/examples_pkcreatect.dox @@ -1,22 +1,36 @@ \section examples_pkcreatect Examples of pkcreatect + +Attach a color table to image with values between 0 and 50 + \code pkcreatect -i image.tif -o image_ct.tif -min 0 -max 50 \endcode -attach color table to image with values between 0 and 50 +Attach a grey scale "color" table to image with values between 0 and 100 and create a legend image (annotation needs to be drawn manually) \code pkcreatect -i image.tif -o image_ct.tif -min 0 -max 100 -l legend.tif -g \endcode -attach grey scale "color" table to image with values between 0 and 100 and create a legend image (annotation needs to be drawn manually) + +Attach a predefined color table to image.tif. The colortable has 5 entries for the values 0 (black), 1 (red), 2 (green), 3 (blue) and 4 (grey) + +\code +cat colortable.txt + +0 0 0 0 255 +1 255 0 0 255 +2 0 255 0 255 +3 0 0 255 255 +4 100 100 100 255 +\endcode \code -pkcreatect -i image.tif -o image_ct.tif -ct colourtable.txt +pkcreatect -i image.tif -o image_ct.tif -ct colortable.txt \endcode -attach predefined color table to image + +Remove the color table from an image \code pkcreatect -i image.tif -o image_noct.tif -ct none \endcode -remove color table from image diff --git a/doc/examples_pkcrop.dox b/doc/examples_pkcrop.dox index 44e0cff..3b09685 100644 --- a/doc/examples_pkcrop.dox +++ b/doc/examples_pkcrop.dox @@ -1,19 +1,23 @@ \section examples_pkcrop Examples of pkcrop \code + +Crop the input image to the given bounding box + pkcrop -i input.tif -ulx 100 -uly 1000 -lrx 600 -lry 100 -o output.tif \endcode -crop image.tif to the given bounding box + +Crop the input image to the envelop of the given polygon and mask all pixels outside polygon as 0 (using gdal_rasterize) \code pkcrop -i input.tif -e extent.shp -o output.tif gdal_rasterize -i -burn 0 -l extent extent.shp output.tif \endcode -crop image.tif to the envelop of the given polygon and mask all pixels outside polygon as 0 (using gdal_rasterize) + +Extract bands 3,2,1 (starting from 0) in that order from multi-band raster image input.tif \code pkcrop -i input.tif -b 3 -b 2 -b 1 -o output.tif \endcode -extract bands 3,2,1 (starting from 0) in that order from multi-band raster image input.tif \code pkcrop -i fimage.tif -s 100 -ot Byte -o bimage.tif -ct colortable.txt diff --git a/doc/examples_pkextract.dox b/doc/examples_pkextract.dox index b8a978e..384d3d9 100644 --- a/doc/examples_pkextract.dox +++ b/doc/examples_pkextract.dox @@ -1,4 +1,6 @@ \section examples_pkextract Examples of pkextract + +\subsection example_pkextract_vector Using vector samples \code pkextract -i input.tif -s points.sqlite -o extracted.sqlite \endcode @@ -39,6 +41,8 @@ pkextract -i landcover.tif -s polygons.sqlite -r maxvote -o majority.sqlite -pol \endcode Extract the majority class in each polygon for the input land cover map. The land cover map contains five valid classes, labeled 1-5. Other class values (e.g., labeled as 0) are not taken into account in the voting. +\subsection example_pkextract_random Using random and grid samples + \code pkextract -i input.tif -o random.sqlite -rand 100 -median -buf 3 -polygon \endcode @@ -49,6 +53,8 @@ pkextract -i input.tif -o systematic.sqlite -grid 100 -srcnodata 0 \endcode Extract points following a systematic grid with grid cell size of 100 m. Discard pixels that have a value 0 in the input raster dataset. +\subsection example_pkextract_raster Using raster samples + \code pkextract -i input.tif -s sample.tif -o extracted.sqlite -t 10 -c 1 -c 2 -c 3 \endcode diff --git a/doc/examples_pksvm.dox b/doc/examples_pksvm.dox index 3eac3ed..2bf425a 100644 --- a/doc/examples_pksvm.dox +++ b/doc/examples_pksvm.dox @@ -1,16 +1,16 @@ \section examples_pksvm Examples of pksvm \code -pksvm -i input.tif -t training.shp -o output.tif -cv 2 -ct colourtable.txt -cc 1000 -g 0.1 +pksvm -i input.tif -t training.sqlite -o output.tif -cv 2 -ct colourtable.txt -cc 1000 -g 0.1 \endcode -Classify input image input.tif with a support vector machine. A training sample that is provided as a vector (shp) file. It contains all features (same dimensionality as input.tif) in its fields (please check \ref pkextract "pkextract" on how to obtain such a file from a "clean" vector file containing locations only). A two-fold cross validation (cv) is performed (output on screen). The parameters cost and gamma of the support vector machine are set to 1000 and 0.1 respectively. A colour [...] +Classify input image input.tif with a support vector machine. A training sample that is provided as an OGR vector dataset. It contains all features (same dimensionality as input.tif) in its fields (please check \ref pkextract "pkextract" on how to obtain such a file from a "clean" vector file containing locations only). A two-fold cross validation (cv) is performed (output on screen). The parameters cost and gamma of the support vector machine are set to 1000 and 0.1 respectively. A colo [...] \code -pksvm -i input.tif -t training.shp -o output.tif -bs 33 -bag 3 +pksvm -i input.tif -t training.sqlite -o output.tif -bs 33 -bag 3 \endcode Classification using bootstrap aggregation. The training sample is randomly split in three subsamples (33% of the original sample each). \code -pksvm -i input.tif -t training.shp -o output.tif -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 0.2 -p 1 -p 1 -p 1 +pksvm -i input.tif -t training.sqlite -o output.tif -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 0.2 -p 1 -p 1 -p 1 \endcode Classification using prior probabilities for each class. The priors are automatically normalized. The order in which the options -p are provide should respect the alphanumeric order of the class names (class 10 comes before 2...) \ No newline at end of file -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel