Skip to main content
Hi,

 

 

I am a total novice with FME - will be going on some training soon, however I am trying to get familiar with the software prior to that.

 

 

I have what I think is a very simple task but can't seem to figure it out.

 

 

All I want to do is create an excel file with all of the feature classes contained in my geodatabase.

 

 

My geodatabase (version 10.1 in ArcGIS) contains feature datasets - although I do not these listed in my excel output.

 

 

Sorry for asking such a basic question - I am new to the knowledge areas/and community
HI,

 

 

The most simple way will be to generate a new workspace (file>new>generate workspace)

 

Select your input gdb in the wizard as reader, select your feature classes in the table list.

 

Make sure that the fme_feature_type attribute (feature class in esri terninology) is exposed in the additional attributes to expose in the reader parameters.

 

If you are interested in the feature datasets you can also expose the geodb_feature_dataset.

 

 

Select XLS as you output format and a static schema.

 

 

You workspace will be created with a reader and a writer.

 

 

Create a user attribute in the writer (FC)

 

 

Insert a Sampler between the reader and writer, set to group by fme_feature_type, the rest is set correctly. This will sample for one feature per feature class.

 

 

Insert an AttributeCopier after the Sampler, set it to copy the fme_feature_type to FC.

 

 

Run the translation.

 

 

If you want the feature dataset too just ad a second user attribute in the writer (FD) and make sure the AttributeCopier is set to copy the geodb_feature_datset to FD.

 

 

In case something went wrong, set the XLS writer to overwrite existing file in the navigator window.

 

 

Hope this helps,

 

 

Itay

 


Thanks Itay.

 

 

When I add the gdb using your method I end up with all of my feature classes listed under the "Reader" heading - the problem is that I have 84 feature classes that now appear connect to 84 excel writers.

 

 

Do I now need to create 84 Samplers and 84 AttributeCopiers?

 

 

It seems a long way to create the list?
Hi,

 

 

you should end up with one reader and one writer. Make sure you select all your feature classes in the table list.

 

you probably ended with each feature class as a different feature type recreate the workspace and make sure the feature type are merged instead of individual.
Hi Itay,

 

 

Where is the option (when using the Generate Workspace option) to merge feature types?

 

 

I can not see it in the dialog I am using?

 

 

I can see it if a add a writer to a blank workspace though...but not throught eh generate workspace option?

 

 

Thanks for your help.
If you generate a workspace the option will not appear, so if you generate a workspace make sure you are selecting all of the feature classes in the table list at the reader parameters
Ok, so I have realised that this method is not going to work.

 

 

I should  have mentioned that my gdb is just a schematic at the moment.  So while it does contain feature classes - these feature classes do not contain any records.

 

 

is there a way to write out the feature class names without the use of the sample translator?

 

 

 


Hi,

 

 

The "Schema (Any Format)" reader might help you.

 

 

Select Workbench menu Readers > Add Reader to open "Add Reader" dialog box, and set like this.   In Japanese environment, a back slash is displayed as a ? (yen) symbol.

 

 

Just be aware that a folder cannot be selected via "Select File" dialog box. So you will have to type the target *.gdb folder path manually. It's easy to modify after selecting a file in the *.gdb folder.   Click "Parameters" button to open "Schema (Any Format) Parameters" dialog box, specify  Input Format.

 

If ArcGIS has been installed in your machine, "Esri Geodatabase (File Geodatabase ArcObjects)" can be also used.   The Schema reader reads schema of the source dataset.

 

Try connecting the Logger to confirm the contents read by the reader.

 

Takashi
Hi,

 

 

Ok in that case Takashi's advice is the way to go.

 

 

Itay
Yes, Takashi's is the way to go -- the "schema" reader in FME is a bit of an odd bird in that rather than returning data one feature (or row) at a time, it returns schema definitions, one "feature" at a time. So if the input GDB file had 12 tables in it, you'll end up getting 12 features coming out of the Schema reader, one per row.  Just log them or route them to the data inspector and you'll see what attributes they have -- the feature type name, which is the gdb table name, will be there, and you should easily be able to route these to a spreadsheet.

 

 

A great use of FME -- good luck!

Is there a way to do this with sde data?


@danpaoly, you could access ArcSDE system table LAYERS directly. However, I believe Schema Reader is still the better option.


I agree with @bo. Have a good look at the Schema reader (Any format) and use the DuplicateFilter transformer on the feature type. For SDE you could also use the Database reader for the underlying database and read the table GDB_LAYERS. That table should contain a list of all available SDE layers


OR

The other approach would be instead of reading feature, read metadata. from the Feature Read Mode parameter, I have used this option on filegdb and I think it should also work for SDE.

Regards

Zubair


Why does this only give me the first three attributes when I do this?  (it may only be giving me the first ‘real’ attribute because attribute 1 is Arc’s default OBJECTID field, and attribute 2 I think is something added by some non-ESRI database script)  I had a simpler way to doing this but ended up with the same result.


Reply