Geoscience Reference
In-Depth Information
-skip factor
downsampling factor. A factor of ten will report every tenth row column.
-srcwin xoff yoff width height
source window of interest in pixels.
-band b
select input band b (default is first band).
-csv
Use comma separated values for output.
srcfile
The source GDAL raster datasource name.
dstfile
The ASCII output filename.
We will apply gdal2xyz.py to generate a systematic sample for the accuracy
assessment of the forest land cover map in Sect. 17.3.4 . We use a skip factor of 200,
which provides a sample point every 200th row and 200th column from the land cover
map. This corresponds to a systematic grid with a sample every 200
6km.
The following command generates a CSV text file representing the systematic sample
of the land cover map with three comma separated columns (X, Y, class):
×
30 m
=
gdal2xyz.py -csv -skip 200 LC82070232013_fmap_masked.tif
sample.csv
10.4 gdal_fillnodata.py
The gdal_fillnodata.py is a Python script that fills holes in a raster (grid)
file by interpolating surrounding pixels. Holes can be identified as no-data in the
input or by using a mask image (zero is invalid, non-zero is valid). The interpolation
is implemented as an inverse distance weighting algorithm (see Sect. 10.1.1 ). Valid
pixels that can be used for the interpolation are searched in four directions (up,
down, left, right), respecting a maximum distance (defined with the option -md ).
Optionally, an average filter can be applied to the interpolated pixels to smoothen
potential artifacts in the raster output. The average filter has a kernel size of 3
3
pixels and is applied iteratively (as defined by -si ). However, due to a problem in
the current code, this option should be avoided until a fix has been provided.
This tool is typically used to fill a relatively small number of holes in an already
(fixed) gridded input raster file. The utility gdal_grid is preferred to interpolate
non-gridded point data in OGR format and create a raster grid file of optional size
(Fig. 10.2 ).
×
 
 
Search WWH ::




Custom Search