geopython / OWSLib

OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service (hence OWS) interface standards, and their related content models.
https://owslib.readthedocs.io
BSD 3-Clause "New" or "Revised" License
384 stars 275 forks source link

Get WCS data in a specific resolution #802

Open math-sasso opened 2 years ago

math-sasso commented 2 years ago

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
github-actions[bot] commented 2 days ago

This Issue has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days.