Solved

Delete Readers without any features


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.

icon

Best answer by nielsgerrits 27 June 2022, 12:28

View original

5 replies

Userlevel 6
Badge +32

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.

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?

Userlevel 6
Badge +32

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.

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!

Userlevel 6
Badge +32

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