Skip to main content
Solved

Delete Readers without any features


matthewlaw
Contributor
Forum|alt.badge.img

I have a DWG file I'd like to read into FME to extract certain information from. When I add the file in a Reader and choose to read Individual Feature Types, I get >100 different Feature Types, but almost all of these are empty (ie have no features in them when I run everything). Is there a way to easily select and delete these empty Readers, or alternatively to tell FME to only add those which have features in them in the first place?

 

I have tried using the PURGE command in AutoCAD to clear any layers with no features in prior to reading the file in FME, but this doesn't seem to have done anything - I have very little CAD experience so it could definitely be that I've done this incorrectly.

Best answer by nielsgerrits

matthewlaw wrote:

Thanks! This definitely makes the process easier, but I still can't work out a way to automatically discard all the layers without features in (or alternatively to select those with features) – at the moment I still have to go through all the layers manually and pick the ones I want. Is there any way to do what I'm looking to do within FME?

Personally, I almost always use the Generic outputport. (Output Ports --> Single Output Port)

Then use the Data Inspector instead of the Visual Preview on a second monitor to see what data comes out of it. (In options, tab Workbench, is a checkbox "Inspect with Data Inspector when Visual Preview is closed". This is how I and all my coworkers are running FME.)

Then look for attributes I need in the Feature Information window in the Data Inspector. Add an AttributeExposer downstream the FeatureReader's Generic outputport and expose what I need.

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

5 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

Use a FeatureReader instead, then you can easily select the layers you need in the "Feature Types to Read" field. You can Initiate a FeatureReader using a Creator transformer.


matthewlaw
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • June 27, 2022

Thanks! This definitely makes the process easier, but I still can't work out a way to automatically discard all the layers without features in (or alternatively to select those with features) – at the moment I still have to go through all the layers manually and pick the ones I want. Is there any way to do what I'm looking to do within FME?


nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • June 27, 2022
matthewlaw wrote:

Thanks! This definitely makes the process easier, but I still can't work out a way to automatically discard all the layers without features in (or alternatively to select those with features) – at the moment I still have to go through all the layers manually and pick the ones I want. Is there any way to do what I'm looking to do within FME?

Personally, I almost always use the Generic outputport. (Output Ports --> Single Output Port)

Then use the Data Inspector instead of the Visual Preview on a second monitor to see what data comes out of it. (In options, tab Workbench, is a checkbox "Inspect with Data Inspector when Visual Preview is closed". This is how I and all my coworkers are running FME.)

Then look for attributes I need in the Feature Information window in the Data Inspector. Add an AttributeExposer downstream the FeatureReader's Generic outputport and expose what I need.


matthewlaw
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • June 30, 2022
nielsgerrits wrote:

Personally, I almost always use the Generic outputport. (Output Ports --> Single Output Port)

Then use the Data Inspector instead of the Visual Preview on a second monitor to see what data comes out of it. (In options, tab Workbench, is a checkbox "Inspect with Data Inspector when Visual Preview is closed". This is how I and all my coworkers are running FME.)

Then look for attributes I need in the Feature Information window in the Data Inspector. Add an AttributeExposer downstream the FeatureReader's Generic outputport and expose what I need.

Thanks - this is what I needed in the end!


nielsgerrits
VIP
Forum|alt.badge.img+54
nielsgerrits wrote:

Personally, I almost always use the Generic outputport. (Output Ports --> Single Output Port)

Then use the Data Inspector instead of the Visual Preview on a second monitor to see what data comes out of it. (In options, tab Workbench, is a checkbox "Inspect with Data Inspector when Visual Preview is closed". This is how I and all my coworkers are running FME.)

Then look for attributes I need in the Feature Information window in the Data Inspector. Add an AttributeExposer downstream the FeatureReader's Generic outputport and expose what I need.

Cheers. Thanks for the feedback :)


Reply


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