Pythonでsoilgrid画像を取得できません-OWSLib

Sep 07 2020

PythonでOWSLibを使用してimagenGTIFFを取得しようとしていますが、エラーが発生します。手伝ってくれませんか?

コード:

from owslib.wcs import WebCoverageService
wcs = WebCoverageService('http://maps.isric.org/mapserv?map=/map/phh2o.map', version='1.0.0')

bbox = (-54.7968690628577, -28.35600162342199, -54.77831702365789, -28.33600341642725)

response = wcs.getCoverage(
    identifier='phh2o_0-5cm_mean', 
    crs='urn:ogc:def:crs:EPSG::4326',
    bbox=bbox, 
    resx=250, resy=250, 
    format='GEOTIFF_INT16')

response.read()

出力:

b '\ n <ServiceExceptionReport version = "1.2.0" \ nxmlns = "http://www.opengis.net/ogc" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://www.opengis.net/ogc http://schemas.opengis.net/wcs/1.0.0/OGC-exception.xsd">\nmsImageCreate():画像処理エラー。RAW画像の割り当てに失敗しました。メモリ不足です。\ n \ n \ n '

回答

1 JorgeMendes Sep 08 2020 at 07:47

ご要望に応じて、EPSG:4326度を使用した地理座標系を使用しています。リクエストresx=250, resy=250は250度の解像度のグリッドを要求し、サーバーはすべてのデータを読み取って集約グリッドを作成し、メモリ不足を報告しようとします。

あなたが次のようなことを試みるなら 0.001

response = wcs.getCoverage(
    identifier='phh2o_0-5cm_mean', 
    crs='urn:ogc:def:crs:EPSG::4326',
    bbox=bbox, 
    resx=0.001 , resy=0.001, 
    format='GEOTIFF_INT16')

グリッドの取得に成功します(地球上のどこにいるかにもよりますが、解像度は約111メートルです)。