[R-sig-Geo] can't read in shapefile

Vinh Nguyen vinhdizzo at gmail.com
Wed Apr 6 16:52:01 CEST 2016


Hi,

I have two shapefiles, both generated from ArcGIS using similar
methods.  I was able to read in one file using readOGR but not the
other.  Any thoughts on how best to figure out why I can't read in the
file?  Here's the error:

> dFloodRisk <- readOGR(floodshapedir, shapefilebase, verbose=TRUE)
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding,
use_iconv = use_iconv,  :
  Cannot open layer
> traceback()
5: .Call("ogrInfo", as.character(dsn), as.character(layer), PACKAGE = "rgdal")
4: ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,
       swapAxisOrder = swapAxisOrder, require_geomType = require_geomType)
3: withCallingHandlers(expr, message = function(c)
invokeRestart("muffleMessage"))
2: suppressMessages(ogr_info <- ogrInfo(dsn = dsn, layer = layer,
       encoding = encoding, use_iconv = use_iconv, swapAxisOrder =
swapAxisOrder,
       require_geomType = require_geomType))
1: readOGR(floodshapedir, shapefilebase,
       verbose = TRUE)

Thanks for your help.

-- Vinh



More information about the R-sig-Geo mailing list