EcohydroLib  1.29
Functions | Variables
ecohydrolib.ssurgo.rasterize Namespace Reference

Rasterize SSURGO features. More...

Functions

def deleteSoilRasters (context, manifest)
 Delete soil raster maps stored in a project. More...
 
def rasterizeSSURGOFeatures
 Create raster maps, in GeoTIFF format, for SSURGO attributes associated with SSURGO MapunitPoly/MapunitPolyExtended features. More...
 

Variables

 RASTER_ATTRIBUTES = attributequery.ATTRIBUTE_LIST_NUMERIC
 

Detailed Description

Rasterize SSURGO features.

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

Function Documentation

def ecohydrolib.ssurgo.rasterize.deleteSoilRasters (   context,
  manifest 
)

Delete soil raster maps stored in a project.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
manifestDict containing manifest entries. Files associted with entries whose key begins with 'soil_raster_' will be deleted
def ecohydrolib.ssurgo.rasterize.rasterizeSSURGOFeatures (   config,
  outputDir,
  featureFilename,
  featureLayername,
  featureAttrList,
  getResolutionFromRasterFileNamed = None,
  rasterResolutionX = None,
  rasterResolutionY = None 
)

Create raster maps, in GeoTIFF format, for SSURGO attributes associated with SSURGO MapunitPoly/MapunitPolyExtended features.

Note
Will silently exit if rasters already exist.
If getResolutionFromRasterFileNamed as well as rasterResolutionX and rasterResolutionY are specified, output raster resolution will be determined from the file named by getResolutionFromRasterFileNamed.
Parameters
configonfigParser containing the section 'GDAL/OGR' and option 'PATH_OF_GDAL_RASTERIZE'
outputDirString representing the absolute/relative path of the directory into which output rasters should be written
featureFilenameString representing the absolute/relative path of the input feature in ESRI shapefile or OGC GML format
featureLayernameString representing the name of feature layer whose features are to be rasterize
featureAttrListList containing the SSURGO attributes for which raster maps are to be created
getResolutionFromRasterFileNamedString representing the absolute path of an existing raster file from which the output raster resolution should be determined
rasterResolutionXFloat representing the X resolution of the output rasters
rasterResolutionYFloat representing the Y resolution of the output rasters
Returns
Dictionary containing the keys for each soil attribute and values of the names of the raster files generated for that attribute
Exceptions
ConfigParser.NoSectionError
ConfigParser.NoOptionError
Exceptionif featureFilename is neither a SHP nor a GML file
IOError(errno.ENOTDIR)if outputDir is not a directory
IOError(errno.EACCESS)if outputDir is not writable
IOError(errno.EACCESS)if featureFilename is not readable
IOError(errno.ENOENT)if featureFilename is not a file
IOError(errno.EACCES)if getResolutionFromRasterFileNamed is not readable
ValueErrorif rasterResolutionX or rasterResolutionY are not floating point numbers greater than 0
Exceptionif a gdal_rasterize command fails

Variable Documentation

ecohydrolib.ssurgo.rasterize.RASTER_ATTRIBUTES = attributequery.ATTRIBUTE_LIST_NUMERIC