"The `getCoverage` method can now be used to fetch the map segment within the bounding box. Note the other parameters, [Section 1](01-WCS-basic.ipynb) showed how to obtain them."
"The `getCoverage` method can now be used to fetch the map segment within the bounding box. Note the other parameters, [Section 1](01-WCS-basics.ipynb) showed how to obtain them."
]
},
{
...
...
%% Cell type:markdown id: tags:
Obtaining a map segment from a WCS
====================
Obtaining a map segment is another operation greatly simplified by the [OWSLib](https://geopython.github.io/OWSLib/) package. This case is conducted from a pre-established bounding box.
This time a connection is made to the service for soil pH:
The `getCoverage` method can now be used to fetch the map segment within the bounding box. Note the other parameters, [Section 1](01-WCS-basic.ipynb) showed how to obtain them.
The `getCoverage` method can now be used to fetch the map segment within the bounding box. Note the other parameters, [Section 1](01-WCS-basics.ipynb) showed how to obtain them.
%% Cell type:code id: tags:
``` python
response=wcs.getCoverage(
identifier='phh2o_0-5cm_mean',
crs='urn:ogc:def:crs:EPSG::152160',
bbox=bbox,
resx=250,resy=250,
format='GEOTIFF_16')
```
%% Cell type:markdown id: tags:
Now fetch the coverage for Senegal and save it disk:
With the data on the client side some regular interaction can be started with a library like [rasterIO](https://rasterio.readthedocs.io/). First open the file from disk: