gscpy
stable
  • Introduction
  • Installation
  • Examples
  • Technical documentation
    • Import Scripts
    • Database Related Modules
    • Download Related Modules
    • Pre-Processing Related Modules
    • Import Related Modules
    • Export Related Modules
    • Space Time Related Modules
gscpy
  • Docs »
  • Technical documentation »
  • Export Related Modules
  • Edit on GitHub

Export Related Modules¶

Exports GRASS raster maps from a selection into formats which GDAL supports.

class gscpy.out_l_export.out_l_gdal.OutLGdal(type, outdir, pattern=None, exclude=None, mapset=None, region=None, output=None, createopt=None, metaopt=None, nodata=None, suffix=False)[source]¶

Exports GRASS raster maps from a selection into GDAL supported formats.

Parameters:
  • type ({'raster', 'raster_3d', 'vector', 'label', 'region', 'group', 'all'}) – Data type(s).
  • outdir (str) – The directory to write the final files to.
  • pattern (str, optional) – The pattern of file names.
  • exclude (str, optional) – Which files or patterns should be excluded?
  • mapset (str, optional) – Name of mapset to list (default: current search path); ‘*’ for all mapsets in location.
  • region (str, optional) – Name of saved region for map search (default: not restricted); ‘*’ for default region
  • output (str, optional) – Suffix or prefix to the filename (see parameter suffix.
  • createopt (str, optional) – Creation option(s) to pass to the output format driver.
  • metaopt (str, optional) – Metadata key(s) and value(s) to include
  • nodata (float, optional) – Assign a specified nodata value to output bands
  • suffix (bool, optional) – If True, the parameter output is used as suffix. If False (Default) it will be used as prefix.
lkwargs¶

dict – Attributes for g.list module.

ekwargs¶

dict – Attributes for out.gdal module.

list_files(i=False, r=False, e=False, t=False, m=False, f=False)[source]¶
List ass detected files. Note, that only flag i works!
export_files(files)
Export all detected files.
print_products()[source]¶

Print all detected files.

Examples

The general usage is

$ out.l.gdal [-i-x-p] type=string outdir=string [pattern=string] [exclude=string] [mapset=string] [region=string]
[output=string] [createopt=string] [nodata=float] [--verbose] [--quiet]

List raster files that ends with ‘tempmean’ from current mapset to a directory

$ out.l.gdal -p type=raster outdir=/home/user/data pattern=*tempmean

Export raster files that ends with ‘tempmean’ from current mapset to a directory

$ out.l.gdal type=raster outdir=/home/user/data pattern=*tempmean

Export raster files that ends with ‘tempmean’ from current mapset to a directory and add the suffix ‘_export’ to them:

$ out.l.gdal -x type=raster outdir=/home/user/data pattern=*tempmean output=_export

Export all raster files

$ out.l.gdal type=raster outdir=/home/user/data

Notes

Note, it is important for the parameter pattern that the asterisk(‘*’) contains a dot (see examples).

Flags:
  • x : Consider output name as suffix. Otherwise it is considered as prefix.
  • i : Ignore case.
  • p : Print the detected files and exit.
print_products(files)[source]

Print all detected files.

Returns:
Return type:None
Next Previous

© Copyright 2018, Ismail Baris, Nils v. Norsinski Revision 9e9e1a3b.

Built with Sphinx using a theme provided by Read the Docs.