示例#1
0
def getDEMForBoundingBox(config, outputDir, outDEMFilename, bbox, coverage=COVERAGE_SRTM_1DEG_AUS, srs='EPSG:4326', fmt=FORMAT_GEOTIFF, overwrite=True):
    """ Fetch a digital elevation model (DEM) from the GeoBrain WCS4DEM WCS-compliant web service.
        Will write any error returned by query to sys.stderr.
    
        @param config A Python ConfigParser (not currently used)
        @param outputDir String representing the absolute/relative path of the directory into which output DEM should be written
        @param outDEMFilename String representing the name of the DEM file to be written
        @param bbox Dict representing the lat/long coordinates and spatial reference of the bounding box area
            for which the DEM is to be extracted.  The following keys must be specified: minX, minY, maxX, maxY, srs.
        @param coverage String representing the DEM source from which to get the DEM coverage.  Must be a value listed in SUPPORTED_COVERAGE
        @param srs String representing the spatial reference of the raster to be returned.
        @param format String representing the MIME type of the raster format to be returned.  Must be a value listed in 
            SUPPORTED_FORMATS
        @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
    
        @raise IOError if outputDir is not a writable directory
        @raise IOError if outDEMFilename already exists and overwrite is False (see above)
    
        @return Tuple(True if DEM data were fetched and False if not, URL of DEM fetched)
    """
    assert(fmt in SUPPORTED_FORMATS)
    assert(coverage in SUPPORTED_COVERAGE)
    return getRasterForBoundingBox(config, outputDir, outDEMFilename, HOST, URL_PROTO, MIME_TYPE[fmt], bbox, coverage, srs, fmt,
                                   response_crs=srs, store=False, overwrite=overwrite)
    
示例#2
0
def getNLCDForBoundingBox(config, outputDir, outNLCDFilename, bbox, resx, resy, coverage='NLCD2006', srs='EPSG:4326', format='GeoTIFF_BYTE', overwrite=True):
    """ Fetch a NLCD land cover data from ORNL Distributed Active Archive Center for 
        Biogeochemical Dynamics WCS-compliant web service.
        
        Will write any error returned by query to sys.stderr.
    
        @param config A Python ConfigParser (not currently used)
        @param outputDir String representing the absolute/relative path of the directory into which output DEM should be written
        @param outNLCDFilename String representing the name of the NLCD raster file to be written
        @param bbox Dict representing the lat/long coordinates and spatial reference of the bounding box area
            for which the NLCD data are to be extracted.  The following keys must be specified: minX, minY, maxX, maxY, srs.
        @param resx Float representing X resolution of NLCD data to be returned in units of srs
        @param resy Float representing Y resolution of NLCD data to be returned in units of srs
        @param coverage String representing the NLCD version to get.  Must be a value listed in SUPPORTED_COVERAGE
        @param srs String representing the spatial reference of the raster to be returned.
        @param format String representing the type of the raster format to be returned.  Must be a value listed in 
            SUPPORTED_FORMATS
        @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
    
        @raise IOError if outputDir is not a writable directory
        @raise IOError if outNLCDFilename already exists and overwrite is False (see above)
    
        @return Tuple(True if DEM data were fetched and False if not, URL of DEM fetched)
    """
    assert(format in SUPPORTED_FORMATS)
    assert(coverage in SUPPORTED_COVERAGE.keys())
    return getRasterForBoundingBox(config, outputDir, outNLCDFilename, HOST, URL_PROTO, MIME_TYPE, bbox, SUPPORTED_COVERAGE[coverage], srs, format,
                                   response_crs=srs, store=None, resx=resx, resy=resy, interpolation=INTERPOLATION, overwrite=overwrite)
示例#3
0
def getNLCDForBoundingBox(config,
                          outputDir,
                          outNLCDFilename,
                          bbox,
                          resx,
                          resy,
                          coverage='NLCD2006',
                          srs='EPSG:4326',
                          format='GeoTIFF_BYTE',
                          overwrite=True):
    """ Fetch a NLCD land cover data from ORNL Distributed Active Archive Center for 
        Biogeochemical Dynamics WCS-compliant web service.
        
        Will write any error returned by query to sys.stderr.
    
        @param config A Python ConfigParser (not currently used)
        @param outputDir String representing the absolute/relative path of the directory into which output DEM should be written
        @param outNLCDFilename String representing the name of the NLCD raster file to be written
        @param bbox Dict representing the lat/long coordinates and spatial reference of the bounding box area
            for which the NLCD data are to be extracted.  The following keys must be specified: minX, minY, maxX, maxY, srs.
        @param resx Float representing X resolution of NLCD data to be returned in units of srs
        @param resy Float representing Y resolution of NLCD data to be returned in units of srs
        @param coverage String representing the NLCD version to get.  Must be a value listed in SUPPORTED_COVERAGE
        @param srs String representing the spatial reference of the raster to be returned.
        @param format String representing the type of the raster format to be returned.  Must be a value listed in 
            SUPPORTED_FORMATS
        @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
    
        @raise IOError if outputDir is not a writable directory
        @raise IOError if outNLCDFilename already exists and overwrite is False (see above)
    
        @return Tuple(True if DEM data were fetched and False if not, URL of DEM fetched)
    """
    assert (format in SUPPORTED_FORMATS)
    assert (coverage in list(SUPPORTED_COVERAGE.keys()))
    return getRasterForBoundingBox(config,
                                   outputDir,
                                   outNLCDFilename,
                                   HOST,
                                   URL_PROTO,
                                   MIME_TYPE,
                                   bbox,
                                   SUPPORTED_COVERAGE[coverage],
                                   srs,
                                   format,
                                   response_crs=srs,
                                   store=None,
                                   resx=resx,
                                   resy=resy,
                                   interpolation=INTERPOLATION,
                                   overwrite=overwrite)
示例#4
0
def getDEMForBoundingBox(config,
                         outputDir,
                         outDEMFilename,
                         bbox,
                         coverage=COVERAGE_SRTM_1DEG_AUS,
                         srs='EPSG:4326',
                         fmt=FORMAT_GEOTIFF,
                         overwrite=True):
    """ Fetch a digital elevation model (DEM) from the GeoBrain WCS4DEM WCS-compliant web service.
        Will write any error returned by query to sys.stderr.
    
        @param config A Python ConfigParser (not currently used)
        @param outputDir String representing the absolute/relative path of the directory into which output DEM should be written
        @param outDEMFilename String representing the name of the DEM file to be written
        @param bbox Dict representing the lat/long coordinates and spatial reference of the bounding box area
            for which the DEM is to be extracted.  The following keys must be specified: minX, minY, maxX, maxY, srs.
        @param coverage String representing the DEM source from which to get the DEM coverage.  Must be a value listed in SUPPORTED_COVERAGE
        @param srs String representing the spatial reference of the raster to be returned.
        @param format String representing the MIME type of the raster format to be returned.  Must be a value listed in 
            SUPPORTED_FORMATS
        @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
    
        @raise IOError if outputDir is not a writable directory
        @raise IOError if outDEMFilename already exists and overwrite is False (see above)
    
        @return Tuple(True if DEM data were fetched and False if not, URL of DEM fetched)
    """
    assert (fmt in SUPPORTED_FORMATS)
    assert (coverage in SUPPORTED_COVERAGE)
    return getRasterForBoundingBox(config,
                                   outputDir,
                                   outDEMFilename,
                                   HOST,
                                   URL_PROTO,
                                   MIME_TYPE[fmt],
                                   bbox,
                                   coverage,
                                   srs,
                                   fmt,
                                   response_crs=srs,
                                   store=False,
                                   overwrite=overwrite)