Solved

feature dataset - use schema reader. expose name

  • 6 October 2017
  • 6 replies
  • 42 views

Badge

say I have a GDB, with a feature dataset

  • fruit (gdb)
    • apples (feature dataset)
      • core
      • slices

using the schema reader, how can I expose the feature dataset name of apples?

exposing all of the attributes in schema reader will not expose the name of the actual feature dataset within apples. I can get all the other attributes using list exploder.

but can't get the feature dataset name.

anyone know how?

icon

Best answer by taojunabc 6 October 2017, 04:24

View original

6 replies

Badge

kind of odd, but in schema reader, "fme_feature_type_name" exposes only the feature type name in this case, core and slices

but if you use a feature reader, "fme_feature_type_name", it exposes as "apples\\core" and "apples\\slice"

maybe its a bug, IDK. I have a workaround, but would be nice if this was in schema reader

Badge +6

This should not be a Bug. The schemareader does not read the featruedatasetname.

You can use GDB reader to expose geodb_feature_dataset. You can set whereClause to "OBJECTID"=1,so you can get a FeatureDataset Name with only one feature.

Of course, the premise of this method is that you have at least one feature per featureclass.

featuredataset-nameexpose.fmwt

Badge

This should not be a Bug. The schemareader does not read the featruedatasetname.

You can use GDB reader to expose geodb_feature_dataset. You can set whereClause to "OBJECTID"=1,so you can get a FeatureDataset Name with only one feature.

Of course, the premise of this method is that you have at least one feature per featureclass.

featuredataset-nameexpose.fmwt

I just used the feature reader to do this, instead of the schema reader.

 

 

Badge +1

This should not be a Bug. The schemareader does not read the featruedatasetname.

You can use GDB reader to expose geodb_feature_dataset. You can set whereClause to "OBJECTID"=1,so you can get a FeatureDataset Name with only one feature.

Of course, the premise of this method is that you have at least one feature per featureclass.

featuredataset-nameexpose.fmwt

The only way I have found (under FME 2021.1) to get the Schema (Any Format) reader to read and record geodatabase (GDB) feature dataset names is:

  1. In a new workspace, add a Schema (Any Format) Reader
  2. DO NOT touch the Format: dropdown. Leave it as "Schema (Any Format)."
  3. For the Dataset: dropdown, enter the GDB whose schema you wish to read. (You may have to enter the path and GDB folder strings manually and separately; the folder navigator under this reader behaves anomalously.)
  4. Under Workflow Options, choose Individual Feature Types
  5. Now, click the Parameters ... button. Notice that the Input Format: dropdown in the dialog that pops up reads "<Guess format name from extension>." DO NOT TOUCH THIS DROPDOWN. The "guess format" mode is what makes the Schema reader read and record feature dataset names. If you use the dropdown to specify "Schema (Any Format)" or to choose one of the specific data formats, you will NEVER see the "guess format" mode choice again in that Schema (Any Format) reader instance. You could try deleting that particular reader and adding another, but, if you have along the way checked a "Save as default parameters" (or whatever that common checkbox says) after changing the Format: or Input Format: dropdowns, you certainly will never see the "guess format" mode choice again. A new workspace is the only way to get it again.

Of course, there's no free lunch ... The output from the reader will prepend FeatureDataset/ to the feature class name and put the whole string in the fme_feature_type_name attribute of the schema object. You will have to post-process fme_feature_type_name to extract the feature dataset names.

 

PLEASE reply here if you have any further information to add. This has been driving me nuts in my current task, and I have had just about as much trouble getting a FeatureReader to read schemas correctly, too.

 

Badge +3

I think/hope I have cracked it:

  • Add a FeatureReader, specify "Esri Geodatabase (File Geodb)", and specify your GDB
  • In "Parameters...", set Feature Read Mode = Metadata

 

This should give you the geodb_feature_dataset attribute on your Generic port, which you will need to expose

Badge +1

I think/hope I have cracked it:

  • Add a FeatureReader, specify "Esri Geodatabase (File Geodb)", and specify your GDB
  • In "Parameters...", set Feature Read Mode = Metadata

 

This should give you the geodb_feature_dataset attribute on your Generic port, which you will need to expose

@Arnold Bijlsma​ Very nice! Thank you so very much for answering this rather old message. I haven't run into this problem much since, but just lately I have, and it was critical that I solve it. You did that, and I am grateful. Other above solutions work, but they require a feature from which to extract the feature dataset. I am dealing with empty template geodatabases.

 

It really gets my goat that the solution was a parameter that was sitting there all along but one that is undocumented in the FME help files. I had no idea really what the Metadata choice for that parameter did, and I never investigated it. Serves me right not to be curious, but really, Safe: update your FeatureReader (transformer) help files to document this parameter!

 

Thanks, again, for this answer!

Reply