@amdubois For your Geodatabase reader, you might be able to formulate a SQL query to identify the geometry type. But I think the easiest solution is to just add a GeometryFilter after your FeatureReader's
You can use the Schema (any format) reader to retrieve all the feature class definitions and filter by
fme_geometry{0} = fme_line
You can then send the feature class names in fme_feature_type_name to a FeatureReader to read the actual contents into FME.
This will work with most data formats, including File or Enterprise Geodatabase, Shape, etc. Just be aware that it might not work so well with formats such as (Geo)JSON, as there aren't any hard schema constraints on homogeneous geometry types per feature type.
If your source data contains a lot of non-line data, this could be much faster than using the GeometryFilter as you'll not be reading any non-line features into FME.
@david_r
Thank you for your answer. I'm still having trouble with the Schema reader. I'm not sure when I would be supposed to input the filter query to extract only line geometry. Directly in the Schema reader or in the following FeatureReader? Or would I have to insert a Test tranformer in betweeen? Would I have to expose the fme_geomtry attribute?
If you could add a picture that would really help me, thanks!
@david_r
Thank you for your answer. I'm still having trouble with the Schema reader. I'm not sure when I would be supposed to input the filter query to extract only line geometry. Directly in the Schema reader or in the following FeatureReader? Or would I have to insert a Test tranformer in betweeen? Would I have to expose the fme_geomtry attribute?
If you could add a picture that would really help me, thanks!
Try something like this:
See also the attached workspace template (FME 2020).
I ended using a geometry filter because it was easier than redoing my whole sequence but clearly the schema + tester is much simpler. Thank you all!
I ended using a geometry filter because it was easier than redoing my whole sequence but clearly the schema + tester is much simpler. Thank you all!
I'd argue that the GeometryFilter is actually much simpler, but for some datasets it might be much slower. But for other datasets it might not make much of a difference, so both are equally valid solutions :-)