EcohydroLib  1.29
Classes | Functions | Variables
ecohydrolib.usgs.demwcs Namespace Reference

Make WCS 1.1.1 query for DEM data hosted by U.S. More...

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']
 

Detailed Description

Make WCS 1.1.1 query for DEM data hosted by U.S.

Geological Survey

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

Copyright (c) 2015, 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

from future import division

Function Documentation

def ecohydrolib.usgs.demwcs.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.usgs.demwcs._BUFF_LEN = 4096
list ecohydrolib.usgs.demwcs.CONTENT_TYPE_ERRORS = ['text/html']
dictionary ecohydrolib.usgs.demwcs.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.usgs.demwcs.DEFAULT_COVERAGE = 'NED'
string ecohydrolib.usgs.demwcs.DEFAULT_RASTER_RESAMPLE_METHOD = 'cubic'
string ecohydrolib.usgs.demwcs.DEFAULT_SRS = 'EPSG:5070'
string ecohydrolib.usgs.demwcs.HOST = 'cida-test.er.usgs.gov'
list ecohydrolib.usgs.demwcs.RASTER_RESAMPLE_METHOD = ['bilinear', 'cubic', 'cubicspline']
string ecohydrolib.usgs.demwcs.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"