OWSLib
OWSLib copied to clipboard
Get WCS data in a specific resolution
Hello. Where can I find the good values o width and height to get data in a specific CRS and Resolution?
I would like to get a bbox in the resolution of 30 seconds (or 0.008333333 in decimal degrees) for soilgrids data. Which values should I pass as resx, resy, width and height?
from owslib.wcs import WebCoverageService
var = "phh2o"
url = "http://maps.isric.org/mapserv?map=/map/{}.map".format(var)
wcs = WebCoverageService(url, version='1.0.0')
variable = 'phh2o_0-5cm_mean'
bbox = (6, 4, 89, 91)
crs='urn:ogc:def:crs:EPSG::4326'
resolution=0.008333333
# Get the data
response = wcs.getCoverage(
identifier=variable,
crs=crs,
bbox=bbox,
resx=resolution,
resy=resolution,
format='GEOTIFF_INT16')
And the error:
/usr/local/lib/python3.7/dist-packages/requests/models.py in raise_for_status(self)
939
940 if http_error_msg:
--> 941 raise HTTPError(http_error_msg, response=self)
942
943 def close(self):
HTTPError: 500 Server Error: Internal Server Error for url: https://maps.isric.org/mapserv?map=/map/phh2o.map&&version=1.0.0&request=GetCoverage&service=WCS&Coverage=phh2o_0-5cm_mean&BBox=6,4,89,91&crs=urn:ogc:def:crs:EPSG::4326&format=GEOTIFF_INT16&resx=0.008333333&resy=0.008333333