2

I am trying to get all layers from gdb file.I am using file geodatabase API. I am unable to find any help regarding how to get all layers and then read that layers.

Right Now i am using
Geodatabase geodatabase = Geodatabase.Open("../../samples/data/Querying.gdb");

//   String allTables = geodatabase.DataSetTypes.;

I have tried several things like get datasetypes and from there get Tables but no luck.

3

If by layer you mean table or featureclass then it is quite straightforward:

foreach (var ds in gdb.GetChildDatasets("\\", string.Empty))
{
    Console.WriteLine(ds);
}
  • sor thanks for replying me back what i understand is getchildDatasets should return all tables placed in gdb folder? Am i right? As it is returning only 2 tables and there are more then 10 .gdtable files – user2174920 Oct 21 '15 at 10:14
  • 1
    It returns all datasets inside the gdb: Featureclasses, Tables, Relationshipclasses, ... The .gdbtable files on the filesystem are not (geo) tables but are used by ArcGIS internally. – Berend Oct 22 '15 at 9:07
  • BTW sir i want to read shape files so I have read all data in table from above cpde which you have mention but i am confused in how to get shape files from them? – user2174920 Oct 26 '15 at 4:47
  • @MuneemHabib Could you please post this as a separate qusetion? – Berend Oct 26 '15 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.