EcohydroWorkflowLib  0.973
 All Classes Namespaces Files Functions Variables Pages
Variables
GetCatchmentShapefileForStreamflowGage Namespace Reference

Query NHDPlus2 database for shapefile of the drainage area of the given streamflow gage. More...

Variables

tuple parser argparse.ArgumentParser(description='Get shapefile for the drainage area of an NHDPlus2 streamflow gage')
 
string help 'The configuration file'
 
tuple args parser.parse_args()
 
 configFile None
 
tuple config ConfigParser.RawConfigParser()
 
 projectDir args.projectDir
 
 outfile args.outfile
 
tuple studyArea GenericMetadata.readStudyAreaEntries(projectDir)
 
list reachcode studyArea['nhd_gage_reachcode']
 
list measure studyArea['nhd_gage_measure_pct']
 
string shapeFilename "%s.shp"
 
tuple shapeFilepath os.path.join(projectDir, shapeFilename)
 

Detailed Description

Query NHDPlus2 database for shapefile of the drainage area of the given streamflow gage.

Resulting shapefile will use WGS84 (EPSG:4326) for its spatial reference.

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: 'NHDPLUS2', 'PATH_OF_NHDPLUS2_DB' 'NHDPLUS2', 'PATH_OF_NHDPLUS2_CATCHMENT'
  1. The following metadata entry(ies) must be present in the study area section of the metadata associated with the project directory: nhd_gage_reachcode nhd_gage_measure_pct

Post conditions

  1. Will write the following entry(ies) to the manifest section of metadata associated with the project directory: study_area_shapefile [the name of the catchment shapefile]

Usage:

1 GetCatchmentShapefileForStreamflowGage.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 GetCatchmentShapefileForStreamflowGage.args parser.parse_args()
tuple GetCatchmentShapefileForStreamflowGage.config ConfigParser.RawConfigParser()
list GetCatchmentShapefileForStreamflowGage.configFile None
string GetCatchmentShapefileForStreamflowGage.help 'The configuration file'
list GetCatchmentShapefileForStreamflowGage.measure studyArea['nhd_gage_measure_pct']
string GetCatchmentShapefileForStreamflowGage.outfile args.outfile
tuple GetCatchmentShapefileForStreamflowGage.parser argparse.ArgumentParser(description='Get shapefile for the drainage area of an NHDPlus2 streamflow gage')
tuple GetCatchmentShapefileForStreamflowGage.projectDir args.projectDir
list GetCatchmentShapefileForStreamflowGage.reachcode studyArea['nhd_gage_reachcode']
string GetCatchmentShapefileForStreamflowGage.shapeFilename "%s.shp"
tuple GetCatchmentShapefileForStreamflowGage.shapeFilepath os.path.join(projectDir, shapeFilename)
tuple GetCatchmentShapefileForStreamflowGage.studyArea GenericMetadata.readStudyAreaEntries(projectDir)