gemgis.web.load_as_file#

gemgis.web.load_as_file(url: str, path: str, overwrite_file: bool = False, create_directory: bool = False)#

Executing WCS request and downloading file into specified folder

Parameters
  • url (str) – Url for request

  • path (str) – Path where file is saved, e.g. path='tile.tif'

  • overwrite_file (bool) – Variable to overwrite an already existing file. Options include: True or False, default set to False

  • create_directory (bool) – Variable to create a new directory of directory does not exist Options include: True or False, default set to False

New in version 1.0.x.

Example

>>> # Loading Libraries and WCS Service
>>> import gemgis as gg
>>> wcs = gg.web.load_wms(url='https://www.wcs.nrw.de/geobasis/wcs_nw_dgm')
>>> wcs
<owslib.coverage.wcs201.WebCoverageService_2_0_1 at 0x27fc64783d0>
>>> # Creating Request for WCS Service
>>> url = gg.web.create_request(url=wcs.url, version=wcs.version, identifier='nw_dgm', form='image/tiff', extent=[0, 1000, 0, 1000], name='test.tif'])
>>> # Downloading file from WCS Service
>>> gg.web.load_as_file(url=url, path='tile.tif')

See also

load_wcs

Load WCS Service

create_request

Create request for WCS

load_as_files

Download WCS data files