0

I want to use a function mapunit_geom_by_ll_bbox from soilDB package in R which is supposed to download a GML file containing from the web, and read the GML using readOGR to return me an SpatialPolygonsDataFrame (i think) object. Although the function downloads the GML file successfully, it fails during readOGR step, and gives me an error:

Specifically, the code reads:

library(soilDB)
library(rgdal)
mapunit_geom_by_ll_bbox( c(-120.54,38.61,-120.41,38.70) )

and the error (with other messages) thrown is:

trying URL 'https://sdmdataaccess.nrcs.usda.gov/Spatial/SDMNAD83Geographic.wfs?Service=WFS&Version=1.0.0&Request=GetFeature&Typename=MapunitPoly&BBOX=-120.54,38.61,-120.41,38.7'
Content type 'text/xml; charset=utf-8' length 1547808 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  :
  Cannot open file

This error was thrown in the Centos 6.6 machine, but when tried in Windows, it runs successfully. Also, "GML" %in% rgdal::ogrDrivers()$name returns TRUE, so there is GML driver in the machine.

I would love to know why the issue exist. Can someone please guide me?

  • Hmmm, I was able to run this without error on ubuntu 16.04, sounds like it might be Centos specific. Maybe raise a github issue? – Stedy Aug 30 '17 at 04:30
  • @Stedy I do not know how to raise a github issue. Also, it seems to me a problem of rgdal, but the function I am using is under soilDB. So what do you suggest? – Prasanna dahal Aug 31 '17 at 00:10
  • yeah but the function works fine on my ubuntu machine and your Windows machine so it seems to me like it might be something with your Centos 6.6 machine. Hard to answer without more information but would it be possible to just use the Windows machine you previously used? – Stedy Aug 31 '17 at 14:32

0 Answers0