gdalextras.gxba

Generate a new dataset from a source dataset using FIR Filters.

This tool uses the vrtlib to create a kernel filtered source and “gdal_translate” to built the destination dataset according to the parameters set by the user.

The tool perform the following operations:

  • temporary vrt dataset creation[default: the entire image is processed]
  • output format conversion [default: the entire image is processed]
  • output image resizing (optional)

Almost all parameters are configurable and have defaults suitable for common tasks.

Functions

add_inSection_option(parser) It defines the input specific options
add_outSection_option(parser) It defines the output specific options
add_specSection_option(parser) It defines the tool specific options
check_inopts(options) It validates the input options
check_outopts(options) It checks the output options
check_specopts(options) It checks the output options
check_tool_args(args, parser) check the correct number of compulsory command line fields
choose_method(option, opt_str, value, parser) It checks if a selection method is present.
convert_in_off(coors) It converts from (xmi,ymin,xmax,ymax) in (xoff,yoff,xsize,ysize)
default_transftype(in_dtype, out_dtype, pixfun) Compute the most appropriate transfer data type for the output image.
fixDerivedRasterband(tree, pixfunc[, rbInd, ...]) It puts in the correct format the derived rasterband in the xml structure.
gdal_outformats() Build dictionary with all drivers supported by GDAL
handle_cmdline() Handle command line arguments and options
issubdataset_(fname)
main() Main function for FIR filtered generation.
parse_tree(source[, parser])
process(options, args, tmpfileobj)
translate(options, args, tmpfileobj)
translatecmd(options, src, dst, pixfun) Generate the command line for “gdal_translate” execution.

Classes

OptionGroup(parser, title[, description])
OptionParser([usage, option_list, ...]) Class attributes:

Exceptions

OptionValueError(msg) Raised if an invalid option value is encountered on the command
gdalextras.gxba.add_inSection_option(parser)
It defines the input specific options
gdalextras.gxba.add_outSection_option(parser)
It defines the output specific options
gdalextras.gxba.add_specSection_option(parser)
It defines the tool specific options
gdalextras.gxba.check_inopts(options)
It validates the input options
gdalextras.gxba.check_outopts(options)
It checks the output options
gdalextras.gxba.check_specopts(options)
It checks the output options
gdalextras.gxba.check_tool_args(args, parser)

check the correct number of compulsory command line fields

3 for FIR filters : * pixel function * input filename * output filename

gdalextras.gxba.choose_method(option, opt_str, value, parser)
It checks if a selection method is present. If it isn’t present, set the correct attribute
gdalextras.gxba.convert_in_off(coors)
It converts from (xmi,ymin,xmax,ymax) in (xoff,yoff,xsize,ysize)
gdalextras.gxba.default_transftype(in_dtype, out_dtype, pixfun)

Compute the most appropriate transfer data type for the output image.

Parameters :
  • in_datatype: int

    a gdal data type for input

  • out_datatype: int

    a gdal data type for output

  • pixfun: str

Return :
  • transfer_dtype: str

    a gdal data type for internal virtual file operations

PIXFUN IN DTYPE OUT DTYPE -> TRANSFER DTYPE any T1 T2 _default_outdtype(T1) any <C>T1 T2 <C>_default_outdtype(T1) any T1 <C>T2 <C>_default_outdtype(T1) any <C>T1 <C>T2 <C>_default_outdtype(T1)

gdalextras.gxba.gdal_outformats()
Build dictionary with all drivers supported by GDAL
gdalextras.gxba.handle_cmdline()
Handle command line arguments and options
gdalextras.gxba.issubdataset_(fname)
gdalextras.gxba.main()

Main function for FIR filtered generation.

Uses “sys.argv” for getting inputs.

gdalextras.gxba.process(options, args, tmpfileobj)
gdalextras.gxba.translate(options, args, tmpfileobj)
gdalextras.gxba.translatecmd(options, src, dst, pixfun)

Generate the command line for “gdal_translate” execution.

The command line in returned in form of list of strings.

Previous topic

gdalextras

Next topic

gdalextras.gxbaui

This Page