EcohydroLib  1.29
Classes | Functions | Variables
ecohydrolib.usgsdem Namespace Reference

Classes

class  USGSDEMCoverageHandler
 

Functions

def getDEMForBoundingBox
 Fetch U.S. More...
 

Variables

int _BUFF_LEN = 4096
 
string HOST = 'cida-test.er.usgs.gov'
 
string URL_PROTO = "/nhdplus/geoserver/ows?service=WCS&version=1.1.1&request=GetCoverage&identifier={coverage}&boundingBox={x1},{y1},{x2},{y2},urn:ogc:def:crs:{bbox_srs}&gridBaseCRS=urn:ogc:def:crs:EPSG::5070&gridOffsets={xoffset},{yoffset}&format=image/tiff&store=true"
 
string DEFAULT_SRS = 'EPSG:5070'
 
string DEFAULT_RASTER_RESAMPLE_METHOD = 'cubic'
 
list RASTER_RESAMPLE_METHOD = ['bilinear', 'cubic', 'cubicspline']
 
string DEFAULT_COVERAGE = 'NED'
 
dictionary COVERAGES
 
list CONTENT_TYPE_ERRORS = ['text/html']
 

Function Documentation

def ecohydrolib.usgsdem.getDEMForBoundingBox (   config,
  outputDir,
  outFilename,
  bbox,
  srs,
  coverage = DEFAULT_COVERAGE,
  resx = None,
  resy = None,
  interpolation = DEFAULT_RASTER_RESAMPLE_METHOD,
  scale = 1.0,
  overwrite = True,
  verbose = False,
  outfp = sys.stdout 
)

Fetch U.S.

1/3 arcsecond DEM data hosted by U.S. Geological Survey using OGC WCS 1.1.1 query.

    @note Adapted from code provided by dblodgett@usgs.gov.

    @param config A Python ConfigParser (not currently used)
    @param outputDir String representing the absolute/relative path of the directory into which output raster should be written
    @param outFilename String representing the name of the raster file to be written
    @param bbox Dict representing the lat/long coordinates and spatial reference of the bounding box area
        for which the raster is to be extracted.  The following keys must be specified: minX, minY, maxX, maxY, srs.
    @param srs String representing the spatial reference of the raster to be returned.
    @param coverage String representing the raster source from which to get the raster coverage.  Must be one of: NHDPlus_hydroDEM, NED
    @param resx Float representing the X resolution of the raster(s) to be returned
    @param resy Float representing the Y resolution of the raster(s) to be returned
    @param interpolation String representing interpolation method.  Must be one of RASTER_RESAMPLE_METHOD.  Defaults to DEFAULT_RASTER_RESAMPLE_METHOD.
    @param scale Float representing factor by which to scale elevation data.  Defaults to 1.0.
    @param overwrite Boolean value indicating whether or not the file indicated by filename should be overwritten.
        If False and filename exists, IOError exception will be thrown with errno.EEXIST
    @param verbose Boolean True if detailed output information should be printed to outfp
    @param outfp File-like object to which verbose output should be printed

    @raise IOError if outputDir is not a writable directory
    @raise IOError if outFilename already exists and overwrite is False (see above)
    @raise Exception if there was an error making the WCS request

    @return Tuple(True if raster data were fetched and False if not, URL of raster fetched)

Variable Documentation

int ecohydrolib.usgsdem._BUFF_LEN = 4096
list ecohydrolib.usgsdem.CONTENT_TYPE_ERRORS = ['text/html']
dictionary ecohydrolib.usgsdem.COVERAGES
Initial value:
1 = { 'NHDPlus_hydroDEM':
2  {'srs': DEFAULT_SRS,
3  'grid_origin': [-2356109.9999999995, 3506249.9999999967],
4  'grid_offset': [30.000000000000245, -30.00000000000047],
5  'grid_extent': [2419274.9999999995, 186285.00000000186]},
6  'NED':
7  {'srs': DEFAULT_SRS,
8  'grid_origin': [-2470950.0000000005, 3621360.000000002],
9  'grid_offset': [30.0, -30.0],
10  'grid_extent': [2258235.0000000377, 209654.99999994505]}
11  }
string ecohydrolib.usgsdem.DEFAULT_COVERAGE = 'NED'
string ecohydrolib.usgsdem.DEFAULT_RASTER_RESAMPLE_METHOD = 'cubic'
string ecohydrolib.usgsdem.DEFAULT_SRS = 'EPSG:5070'
string ecohydrolib.usgsdem.HOST = 'cida-test.er.usgs.gov'
list ecohydrolib.usgsdem.RASTER_RESAMPLE_METHOD = ['bilinear', 'cubic', 'cubicspline']
string ecohydrolib.usgsdem.URL_PROTO = "/nhdplus/geoserver/ows?service=WCS&version=1.1.1&request=GetCoverage&identifier={coverage}&boundingBox={x1},{y1},{x2},{y2},urn:ogc:def:crs:{bbox_srs}&gridBaseCRS=urn:ogc:def:crs:EPSG::5070&gridOffsets={xoffset},{yoffset}&format=image/tiff&store=true"