EcohydroLib  1.29
Variables
GenerateSoilPropertyRastersFromSOLIM Namespace Reference

Infer soil attributes associated with SSURGO mapunit features using SOLIM. More...

Variables

tuple parser = argparse.ArgumentParser(description='Get SSURGO features for a bounding box')
 
string help = 'The configuration file'
 
tuple args = parser.parse_args()
 
tuple cmdline = GenericMetadata.getCommandLine()
 
 configFile = None
 
tuple context = Context(args.projectDir, configFile)
 
list ssurgoProvenance = [i for i in GenericMetadata.readAssetProvenanceObjects(context) if i.name == 'soil_features']
 
tuple manifest = GenericMetadata.readManifestEntries(context)
 
list shpFilename = manifest['soil_features']
 
tuple shpFilepath = os.path.join(context.projectDir, shpFilename)
 
list demFilename = manifest['dem']
 
tuple demFilepath = os.path.join(context.projectDir, demFilename)
 
tuple layerName = os.path.splitext(shpFilename)
 
tuple studyArea = GenericMetadata.readStudyAreaEntries(context)
 
list outputrasterresolutionX = studyArea['dem_res_x']
 
list outputrasterresolutionY = studyArea['dem_res_y']
 
list attrList = [elem[:10] for elem in attributequery.ATTRIBUTE_LIST_NUMERIC]
 
tuple rasterFiles
 
tuple asset = AssetProvenance(GenericMetadata.MANIFEST_SECTION)
 

Detailed Description

Infer soil attributes associated with SSURGO mapunit features using SOLIM.

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: 'SOLIM', 'PATH_OF_SOLIM'
  2. The following metadata entry(ies) must be present in the manifest section of the metadata associated with the project directory: soil_features [the name of the vector file containing the soil features]
  3. The following metadata entry(ies) must be present in the study area section of the metadata associated with the project directory: dem_res_x dem_res_y

Post conditions

  1. Will write the following entry(ies) to the manifest section of metadata associated with the project directory: soil_raster_<attr> [the name of the raster file for each soil property raster]

Usage:

1 GenerateSoilPropertyRastersFromSOLIM.py -p /path/to/project_dir
Note
EcohydroLib configuration file must be specified by environmental variable 'ECOHYDROWORKFLOW_CFG', or -i option must be specified.
Todo:
Recognize when DEM resolution is less than 10m, resample temporary DEM, run SOLIM with resampled DEM

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: 'SOLIM', 'PATH_OF_SOLIM'
  2. The following metadata entry(ies) must be present in the manifest section of the metadata associated with the project directory: soil_features [the name of the vector file containing the soil features]
  3. The following metadata entry(ies) must be present in the study area section of the metadata associated with the project directory: dem_res_x dem_res_y

Post conditions

  1. Will write the following entry(ies) to the manifest section of metadata associated with the project directory: soil_raster_<attr> [the name of the raster file for each soil property raster]

Usage:

1 GenerateSoilPropertyRastersFromSOLIM.py -p /path/to/project_dir
Note
EcohydroLib configuration file must be specified by environmental variable 'ECOHYDROWORKFLOW_CFG', or -i option must be specified.
Todo:
Recognize when DEM resolution is less than 10m, resample temporary DEM, run SOLIM with resampled DEM

Variable Documentation

tuple GenerateSoilPropertyRastersFromSOLIM.args = parser.parse_args()
tuple GenerateSoilPropertyRastersFromSOLIM.asset = AssetProvenance(GenericMetadata.MANIFEST_SECTION)
list GenerateSoilPropertyRastersFromSOLIM.attrList = [elem[:10] for elem in attributequery.ATTRIBUTE_LIST_NUMERIC]
tuple GenerateSoilPropertyRastersFromSOLIM.cmdline = GenericMetadata.getCommandLine()
GenerateSoilPropertyRastersFromSOLIM.configFile = None
tuple GenerateSoilPropertyRastersFromSOLIM.context = Context(args.projectDir, configFile)
list GenerateSoilPropertyRastersFromSOLIM.demFilename = manifest['dem']
tuple GenerateSoilPropertyRastersFromSOLIM.demFilepath = os.path.join(context.projectDir, demFilename)
string GenerateSoilPropertyRastersFromSOLIM.help = 'The configuration file'
tuple GenerateSoilPropertyRastersFromSOLIM.layerName = os.path.splitext(shpFilename)
tuple GenerateSoilPropertyRastersFromSOLIM.manifest = GenericMetadata.readManifestEntries(context)
list GenerateSoilPropertyRastersFromSOLIM.outputrasterresolutionX = studyArea['dem_res_x']
list GenerateSoilPropertyRastersFromSOLIM.outputrasterresolutionY = studyArea['dem_res_y']
tuple GenerateSoilPropertyRastersFromSOLIM.parser = argparse.ArgumentParser(description='Get SSURGO features for a bounding box')
tuple GenerateSoilPropertyRastersFromSOLIM.rasterFiles
Initial value:
1 = inferSoilPropertiesForSSURGOAndTerrainData(config=context.config, outputDir=context.projectDir, \
2  shpFilepath=shpFilepath, demFilepath=demFilepath, \
3  featureAttrList=attrList)
def inferSoilPropertiesForSSURGOAndTerrainData
Infer soil properties from SSURGO and terrain data using SOLIM framework.
Definition: inference.py:59
list GenerateSoilPropertyRastersFromSOLIM.shpFilename = manifest['soil_features']
tuple GenerateSoilPropertyRastersFromSOLIM.shpFilepath = os.path.join(context.projectDir, shpFilename)
list GenerateSoilPropertyRastersFromSOLIM.ssurgoProvenance = [i for i in GenericMetadata.readAssetProvenanceObjects(context) if i.name == 'soil_features']
tuple GenerateSoilPropertyRastersFromSOLIM.studyArea = GenericMetadata.readStudyAreaEntries(context)