Python으로 SoilGrid 이미지를 얻을 수 없습니다-OWSLib

Sep 07 2020

Python에서 OWSLib를 사용하여 imagen GTIFF를 가져 오려고하는데 오류가 발생합니다. 저 좀 도와 주 시겠어요?

암호:

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 버전 = "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 () : 이미지 처리 오류입니다. 원시 이미지를 할당하지 못했습니다. 메모리가 부족합니다. \ 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 미터).