gdalextras.gxfir

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, parser)
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)
gdal_outformats() Build dictionary with all drivers supported by GDAL
handle_cmdline() Handle command line arguments and options
main() Main function for FIR filtered generation.
parse_tree(source[, parser])
process(options, args, tmpfileobj)
translate(options, args, tmpfileobj)
translatecmd(options, src, dst) 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.gxfir.add_inSection_option(parser)
It defines the input specific options
gdalextras.gxfir.add_outSection_option(parser)
It defines the output specific options
gdalextras.gxfir.add_specSection_option(parser)
It defines the tool specific options
gdalextras.gxfir.check_inopts(options)
It validates the input options
gdalextras.gxfir.check_outopts(options)
It checks the output options
gdalextras.gxfir.check_specopts(options, parser)
gdalextras.gxfir.check_tool_args(args, parser)

check the correct number of compulsory command line fields

4 at least for FIR filters : * input filename * output filename * filter order * filter cutoff

gdalextras.gxfir.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.gxfir.convert_in_off(coors)
It converts from (xmi,ymin,xmax,ymax) in (xoff,yoff,xsize,ysize)
gdalextras.gxfir.gdal_outformats()
Build dictionary with all drivers supported by GDAL
gdalextras.gxfir.handle_cmdline()
Handle command line arguments and options
gdalextras.gxfir.main()

Main function for FIR filtered generation.

Uses “sys.argv” for getting inputs.

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

Generate the command line for “gdal_translate” execution.

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

Previous topic

gdalextras.gxbaui

Next topic

gdalextras.gxfirui

This Page