I am trying to read shapefiles contained within a geodatabase file (.gdb) into R. The .gdb contains two Feature Datasets with multiple Feature Classes within each.
The problem is only one of the two Feature Datasets is being read. Specifically, I am using the NHD dataset for all states ftp://nhdftp.usgs.gov/DataSets/Staged/States/FileGDB/HighResolution/ In each state .gdb are two feature Datasets, 'WBD' and 'Hydrography'. Only 'WBD' is being read. Using ogrListLayers only returns layers from 'WBD'. How can I specify the 'Hydrography' dataset and access the Feature Classes within it?
Any suggestions would be much appreciated. R version 3.2.0. OSX v.10.10.3
Edit 06/16/15: When I run orgListLayers, it returns:
ogrListLayers('NHDH_VI.gdb')
[1] "ExternalCrosswalk" "NHDFCode" "NHDFeatureToMetadata"
[4] "NHDFlow" "NHDFlowlineVAA" "NHDMetadata"
[7] "NHDProcessingParameters" "NHDReachCodeMaintenance" "NHDReachCrossReference"
[10] "NHDSourceCitation" "NHDStatus" "NHDVerticalRelationship"
[13] "WBDHU14" "WBDHU8" "WBDHU2"
[16] "WBDHU4" "WBDHU6" "WBDHU10"
[19] "WBDHU12" "WBDHU16" "HYDRO_NET_Junctions"
The 21 layers are different then expressed by Mike T and hrbrmstr. Specifically I am looking for: Layer name: NHDWaterbody.
When I runogrinfo -ro NHDH_VI.gdb
from terminal.
ERROR 1: Error: Failed to open Geodatabase (This release of the GeoDatabase is either invalid or out of date.)
FAILURE: Unable to open datasource `NHDH_VI.gdb' with the following drivers.
-> FileGDB
-> OpenFileGDB
...
THIS IS NOT AN ANSWER but more space is needed for clarification since the OP did not provide a reproducible example. I will delete this once the OP q is more complete.
When I run
ogrinfo
onNHDH_CT.gdb
(one of the smaller archives) I get:That matches:
What are you expecting to see? What does your
ogrinfo
show? (NOTE: Hawaii's gave similar output).