I am trying to read a table from an ESRI geodatabase (.gdb) that has no geometry using R. readOGR is throwing an error because there is no geometry defined, which kind of make sense:
# Load module to get readOGR
require('rgdal');
# Load module to get read.dbf
require('foreign');
Le chargement a nécessité le package : foreign
# goto the directory with the GDB files
fgdb <- "c:/Mrnmicro/VulnerabilitePeuplements/gdb/Produits_IEQM_04151.gdb"
# List all feature classes in a file geodatabase
subset(ogrDrivers(), grepl("GDB", name))
name long_name write copy isVector
34 OpenFileGDB ESRI FileGDB FALSE FALSE TRUE
ogrListLayers(fgdb)
[1] "ESSENCE_MAJ" "ETAGE_MAJ" "Perimetre" "PEE_MAJ" "META_MAJ"
attr(,"driver")
[1] "OpenFileGDB"
attr(,"nlayers")
[1] 5
# Read the feature class
fc = readOGR(dsn=fgdb,layer="ESSENCE_MAJ",dropNULLGeometries=FALSE)
Error in readOGR(dsn = fgdb, layer = "ESSENCE_MAJ", dropNULLGeometries = FALSE) :
no features found
In addition: Warning message:
In ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, :
ogrInfo: all features NULL
----------
The same code with another layer (that is a shapefile) like PEE_MAJ works.
fc = readOGR(dsn=fgdb,layer="PEE_MAJ",dropNULLGeometries=FALSE)
OGR data source with driver: OpenFileGDB
Source: "c:/Mrnmicro/VulnerabilitePeuplements/gdb/Produits_IEQM_04151.gdb", layer: "PEE_MAJ"
with 135202 features
It has 31 fields
Could you please help me to read features contained in the ESSENCE_MAJ table ?