RHESSysWorkflows  1.33
Variables
RegisterLandcoverReclassRules Namespace Reference

Generate landcover raster maps reclassification rules for use with GenerateLandcoverMaps.py. More...

Variables

tuple parser = argparse.ArgumentParser(description='Generate landcover maps in GRASS GIS')
 
string help = 'The configuration file. Must define section "GRASS" and option "GISBASE"'
 
tuple group = parser.add_mutually_exclusive_group(required=True)
 
tuple args = parser.parse_args()
 
tuple cmdline = RHESSysMetadata.getCommandLine()
 
 configFile = None
 
tuple context = Context(args.projectDir, configFile)
 
tuple metadata = RHESSysMetadata.readRHESSysEntries(context)
 
tuple studyArea = RHESSysMetadata.readStudyAreaEntries(context)
 
tuple manifest = RHESSysMetadata.readManifestEntries(context)
 
tuple paths = RHESSysPaths(args.projectDir, metadata['rhessys_dir'])
 
tuple projectDirRuleDir = paths.getReclassRulesDirectory()
 
tuple roadRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_ROAD)
 
tuple imperviousRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_IMPERVIOUS)
 
tuple landuseRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_LANDUSE)
 
tuple stratumRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_STRATUM)
 
tuple laiRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_LAI)
 
 ruleDir = None
 
list landcoverType = studyArea['landcover_type']
 
tuple scriptEtc = context.config.get('SCRIPT', 'ETC')
 

Detailed Description

Generate landcover raster maps reclassification rules for use with GenerateLandcoverMaps.py.

This software is provided free of charge under the New BSD License. Please see the following license information:

Copyright (c) 2013, University of North Carolina at Chapel Hill All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author
Brian Miles brian.nosp@m._mil.nosp@m.es@un.nosp@m.c.ed.nosp@m.u

Pre conditions

  1. Configuration file must define the following sections and values: 'SCRIPT', 'ETC'
  2. The following metadata entry(ies) must be present in the study area section of the metadata associated with the project directory: landcover_type [required only if –generateKnownRules is supplied]
  3. The following metadata entry(ies) must be present in the RHESSys section of the metadata associated with the project directory: rhessys_dir

Post conditions

  1. Will write the following entry(ies) to the RHESSys section of metadata associated with the project directory: landcover_road_rule landcover_impervious_rule landcover_landuse_rule landcover_stratum_rule landcover_lai_rule [if LAI flag is specified]

Usage:

1 RegisterLandcoverReclassRules.py -p /path/to/project_dir
Note
EcoHydroWorkflowLib configuration file must be specified by environmental variable 'ECOHYDROWORKFLOW_CFG', or -i option must be specified.

Variable Documentation

tuple RegisterLandcoverReclassRules.args = parser.parse_args()
tuple RegisterLandcoverReclassRules.cmdline = RHESSysMetadata.getCommandLine()
RegisterLandcoverReclassRules.configFile = None
tuple RegisterLandcoverReclassRules.context = Context(args.projectDir, configFile)
tuple RegisterLandcoverReclassRules.group = parser.add_mutually_exclusive_group(required=True)
string RegisterLandcoverReclassRules.help = 'The configuration file. Must define section "GRASS" and option "GISBASE"'
tuple RegisterLandcoverReclassRules.imperviousRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_IMPERVIOUS)
tuple RegisterLandcoverReclassRules.laiRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_LAI)
list RegisterLandcoverReclassRules.landcoverType = studyArea['landcover_type']
tuple RegisterLandcoverReclassRules.landuseRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_LANDUSE)
tuple RegisterLandcoverReclassRules.manifest = RHESSysMetadata.readManifestEntries(context)
tuple RegisterLandcoverReclassRules.metadata = RHESSysMetadata.readRHESSysEntries(context)
tuple RegisterLandcoverReclassRules.parser = argparse.ArgumentParser(description='Generate landcover maps in GRASS GIS')
tuple RegisterLandcoverReclassRules.paths = RHESSysPaths(args.projectDir, metadata['rhessys_dir'])
tuple RegisterLandcoverReclassRules.projectDirRuleDir = paths.getReclassRulesDirectory()
tuple RegisterLandcoverReclassRules.roadRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_ROAD)
tuple RegisterLandcoverReclassRules.ruleDir = None
tuple RegisterLandcoverReclassRules.scriptEtc = context.config.get('SCRIPT', 'ETC')
tuple RegisterLandcoverReclassRules.stratumRulePath = os.path.join(projectDirRuleDir, RHESSysMetadata.LC_RULE_STRATUM)
tuple RegisterLandcoverReclassRules.studyArea = RHESSysMetadata.readStudyAreaEntries(context)