<strike id="dydih"><source id="dydih"></source></strike>
    <var id="dydih"><output id="dydih"><source id="dydih"></source></output></var>

      <var id="dydih"><strike id="dydih"><form id="dydih"></form></strike></var>
          <acronym id="dydih"><center id="dydih"><dfn id="dydih"></dfn></center></acronym>
          <var id="dydih"></var>

            從終端GET工作 但httr::GET不

            我試圖從httr::GET的服務器下載 rasters,我們曾經有這個工作,但對服務器進行了一些更改,現在它不起作用。

            我試圖從httr::GET的服務器下載 rasters,我們曾經有這個工作,但對服務器進行了一些更改,現在它不起作用。

            通過瀏覽器或通過終端(ubuntu 16.04)中的 GET 使用 URL 工作正常,并返回一個工作 tif raster。但是使用來自httr::GET的相同 url 不起作用,并給出Status: 400。

            我唯一的猜測是它與數據的編碼有關。但我真的不確定。

            file <- paste0(tempdir(), '/file.tif')
            r <- 
              httr::GET('https://map.ox.ac.uk/geoserver/Explorer/ows?service=WCS&version=2.0.1&request=GetCoverage&format=image/geotiff&coverageid=2015_Nature_Africa_PR&SUBSET=Long(-3,50.483779907)&SUBSET=Lat(-25.6089496609999,-11.9454326629999)&SUBSET=time(\"2015-01-01T00:00:00.000Z\")',
                       httr::write_disk(file, overwrite = TRUE))
            ras <- raster::raster(file)
            # I'm now totally confused about when and where quotes are escaped, so just to make sure...
            r <- 
              httr::GET('https://map.ox.ac.uk/geoserver/Explorer/ows?service=WCS&version=2.0.1&request=GetCoverage&format=image/geotiff&coverageid=2015_Nature_Africa_PR&SUBSET=Long(-3,50.483779907)&SUBSET=Lat(-25.6089496609999,-11.9454326629999)&SUBSET=time("2015-01-01T00:00:00.000Z")',
                        httr::write_disk(file, overwrite = TRUE))
            ras <- raster::raster(file)
            # But just putting the url in the browser works fine.
            # https://map.ox.ac.uk/geoserver/Explorer/ows?service=WCS&version=2.0.1&request=GetCoverage&format=image/geotiff&coverageid=2015_Nature_Africa_PR&SUBSET=Long(-3,50.483779907)&SUBSET=Lat(-25.6089496609999,-11.9454326629999)&SUBSET=time("2015-01-01T00:00:00.000Z")
            # eg 
            # rr <- raster::raster('~/Desktop/2015_Nature_Africa_PR3.tif')
            # And using the URL with GET in the terminal works
            # GET "https://map.ox.ac.uk/geoserver/Explorer/ows?service=WCS&version=2.0.1&request=GetCoverage&format=image/geotiff&coverageid=2015_Nature_Africa_PR&SUBSET=Long(-3,50.483779907)&SUBSET=Lat(-25.6089496609999,-11.9454326629999)&SUBSET=time(\"2015-01-01T00:00:00.000Z\")" > ~/Desktop/2015_Nature_Africa_PR4.tif
            # eg
            # rr <- raster::raster('~/Desktop/2015_Nature_Africa_PR4.tif')
            
            5

            包裝在URLEncode為我工作:

            library(httr)
            library(raster)
            file <- paste0(tempdir(), '/file.tif')
            url1 <- 'https://map.ox.ac.uk/geoserver/Explorer/ows?service=WCS&version=2.0.1&request=GetCoverage&format=image/geotiff&coverageid=2015_Nature_Africa_PR&SUBSET=Long(-3,50.483779907)&SUBSET=Lat(-25.6089496609999,-11.9454326629999)&SUBSET=time("2015-01-01T00:00:00.000Z")'
            r   <- GET(URLencode(url1), write_disk(file, overwrite = TRUE))
            ras <- raster(file)
            

            本站系公益性非盈利分享網址,本文來自用戶投稿,不代表碼文網立場,如若轉載,請注明出處

            (426)
            如何快速連續安裝IIS服務器和托管包 而不會遇到錯誤
            上一篇
            在客戶端攔截來自和去往Web服務的SOAP消息
            下一篇

            相關推薦

            發表評論

            登錄 后才能評論

            評論列表(53條)

              又色又黄18禁免费的网站_国产欧美一区二区三区_一道本日本美女在线国产_欧洲无码国产AV

                <strike id="dydih"><source id="dydih"></source></strike>
                <var id="dydih"><output id="dydih"><source id="dydih"></source></output></var>

                  <var id="dydih"><strike id="dydih"><form id="dydih"></form></strike></var>
                      <acronym id="dydih"><center id="dydih"><dfn id="dydih"></dfn></center></acronym>
                      <var id="dydih"></var>