[R-sig-Geo] Reading a WMS layer as a sp object

Manuel Schneider manuel.schneider at art.admin.ch
Mon Aug 15 10:36:57 CEST 2011


Following Michael's advice I'm trying to execute the first example on
http://www.gdal.org/frmt_wms.html and run

gdal_translate <- "C:/Progs/FWTools2.4.7/bin/gdal_translate.exe"
download.file("http://www.gdal.org/frmt_wms_onearth_global_mosaic.xml",
destfile="C:/temp/test.xml")
wms_xml <- "C:/temp/test.xml"
system(paste(gdal_translate, "-of PNG -outsize 512 256", wms_xml, "test.png"))

but I get the following errors

Input file size is 2949120, 1474560
0ERROR 1: GDALWMS: Unable to download block 0, 0.
  URL:
http://onearth.jpl.nasa.gov/wms.cgi?request=GetMap&version=1.1.1&layers=global_mosaic&styles=visual&srs=EPSG:4326&format=image/jpeg&width=512&height=512&bbox=-180.00000000,-166.00000000,76.00000000,90.00000000
  HTTP status code: 0, error: Failed connect to onearth.jpl.nasa.gov:80; No error.
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GDALWMS: Unable to download block 5, 5.
  URL:
http://onearth.jpl.nasa.gov/wms.cgi?request=GetMap&version=1.1.1&layers=global_mosaic&styles=visual&srs=EPSG:4326&format=image/jpeg&width=512&height=512&bbox=-179.68750000,89.62500000,-179.62500000,89.68750000
  HTTP status code: 0, error: Failed connect to onearth.jpl.nasa.gov:80; No error.
ERROR 1: IReadBlock failed at X offset 5, Y offset 5
Warning message:
running command 'C:/ManuProgs/FWTools2.4.7/bin/gdal_translate.exe -of JPEG
-outsize 500 250 C:/temp/test.xml test.jpg' had status 1 

Any advice of the experts is acknowledged in advance

Regards
Manuel



More information about the R-sig-Geo mailing list