Skip to main content
Solved

FeatureReader - Schema GDB name Final Output


galigis
Enthusiast
Forum|alt.badge.img+16

Hi All,

I have created a workspace that reads all GDBs included in a folder (and subfolders) and export a few attributes to an excel file but now need to bring the GDB name (path_filename) into the final output. I tried to expose the attribute to bring it along the workflow but seems isn’t part of the unexposed attributes.

I was expecting to see the GDB name as part of the Generic elements (within the unexposed attributes) but the GDB is only in the <Schema>,

How can I bring the GDB name as column in the final output (excel file in this case)?

<Generic> screenshot

<Schema> Screenshot

 

Best answer by nielsgerrits

You can get fme_basename or fme_dataset, but you have to dig in the FeatureReader’s settings to switch it on:

  • FeatureReader
    • Format = Esri Geodatabase (File Geodb)
    • Parameters…
      • Schema Attributes
        • Additional Attributes to Expose
          • fme_basename
          • fme_dataset
    • <Generic> Port
      • Attributes to Expose
        • fme_basename
        • fme_dataset

As an alternative, this is how I do it:

  • Creator
  • FeatureReader
    • Format = Directory and File Pathnames
    • Path Filter = *.gdb
    • Recurse Into Subfolders = Yes
  • Keeper
    • Attributes to Keep = path_windows
  • FeatureReader
    • Format = Esri Geodatabase (File Geodb)
    • Dataset = path_windows
    • Attribute and Geometry Handling
      • Accumulation Mode = Merge Initiator and Result

This merges path_windows to all features read by the second FeatureReader. If you only want the name, you can always use the FilenamePartExtractor to get it from path_windows, and you probably want to do this before the second FeatureReader.

View original
Did this help you find an answer to your question?

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • March 6, 2024

You can get fme_basename or fme_dataset, but you have to dig in the FeatureReader’s settings to switch it on:

  • FeatureReader
    • Format = Esri Geodatabase (File Geodb)
    • Parameters…
      • Schema Attributes
        • Additional Attributes to Expose
          • fme_basename
          • fme_dataset
    • <Generic> Port
      • Attributes to Expose
        • fme_basename
        • fme_dataset

As an alternative, this is how I do it:

  • Creator
  • FeatureReader
    • Format = Directory and File Pathnames
    • Path Filter = *.gdb
    • Recurse Into Subfolders = Yes
  • Keeper
    • Attributes to Keep = path_windows
  • FeatureReader
    • Format = Esri Geodatabase (File Geodb)
    • Dataset = path_windows
    • Attribute and Geometry Handling
      • Accumulation Mode = Merge Initiator and Result

This merges path_windows to all features read by the second FeatureReader. If you only want the name, you can always use the FilenamePartExtractor to get it from path_windows, and you probably want to do this before the second FeatureReader.


galigis
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • March 6, 2024

Thanks @nielsgerrits - the ‘Accumulation Mode = Merge Initiator and Result’ did the trick :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings