Hi
Seems like you've done a dataset fanout when you needed a feature type fanout. Have a look in the FME documentation under feature type fanouts, it's pretty well explained there.
More details here.
David
Yes, feature type fanout is what you need (as David suggests below). It's a little bit harder to find now; it used to have a specific feature type fanout label but now you just open the feature type parameters and set the feature type name to an attribute. Not sure if we even should call it a 'fanout', but I haven't thought of any better terminology! In our training materials it is in the advanced manual under the section "Advanced Readers and Writers"
David and Mark,
I ONLY have issues on performing feature type fanout with the FGDB writer. Two issues
1) When I add FGDB writer, it still forces me to pick a geometry type, which excludes the resulting FGDB to have feature types of different geometry types.
2) The attribute field in the Feature Type property is disabled for me to specify fanout parameters.
Bo
Hi @bo
As @david_r says, the issue is that a single table can't have multiple geometry types.
Another solution to #1 is to use a dynamic workspace. So open the Feature Type properties dialog. Check the box marked Dynamic. The Geometry Field should now let you choose "From Schema Definition", ie the geometry type is automatically set from the original schema.
You can then choose the attribute you want for the Feature Class/Table name.
However (and this is a little complicated) because you are now in Dynamic mode, FME will try to use the value of the attribute to try and define a schema; which is a problem because the new table names don't exist in the source. So - in brief - set Schema Definition Name to "fme_feature_type"
In other words you are telling FME to:
- Get the table name from the attribute
- Get the schema from the original table name
- Get the geometry from the original table schema
Additionally, you will need to add a suffix (or similar change) to the
fanout attribute for one of the geometry type; because you can't write
two geometries to the same table.
I am attaching a workspace that demonstrates this. In here I have source data of fire stations. Each station has a point to represent it and a polygon to represent its coverage. I wish to create a new table for each station. I can't quite do that, because I can't put points and polygons in the same table, but I can create Station1-Point, Station1-Polygon, Station2-Point, etc
Hopefully this workspace will help explain better than I do above!
For #2, I have no idea why that should not be possible. Again a screenshot would help. In particular, if you click the box labelled Dynamic, what happens? The feature class setting should automatically change to an attribute. Also, what version of FME are you running?
Regards
Mark
Hi @bo
As @david_r says, the issue is that a single table can't have multiple geometry types.
Another solution to #1 is to use a dynamic workspace. So open the Feature Type properties dialog. Check the box marked Dynamic. The Geometry Field should now let you choose "From Schema Definition", ie the geometry type is automatically set from the original schema.
You can then choose the attribute you want for the Feature Class/Table name.
However (and this is a little complicated) because you are now in Dynamic mode, FME will try to use the value of the attribute to try and define a schema; which is a problem because the new table names don't exist in the source. So - in brief - set Schema Definition Name to "fme_feature_type"
In other words you are telling FME to:
- Get the table name from the attribute
- Get the schema from the original table name
- Get the geometry from the original table schema
Additionally, you will need to add a suffix (or similar change) to the
fanout attribute for one of the geometry type; because you can't write
two geometries to the same table.
I am attaching a workspace that demonstrates this. In here I have source data of fire stations. Each station has a point to represent it and a polygon to represent its coverage. I wish to create a new table for each station. I can't quite do that, because I can't put points and polygons in the same table, but I can create Station1-Point, Station1-Polygon, Station2-Point, etc
Hopefully this workspace will help explain better than I do above!
For #2, I have no idea why that should not be possible. Again a screenshot would help. In particular, if you click the box labelled Dynamic, what happens? The feature class setting should automatically change to an attribute. Also, what version of FME are you running?
Regards
Mark
NB: I'm using 2016.1 here, with the File Geodatabase API Writer.
@mark2catsafe and @david_r, Thanks for the help. I was out of town for a few days and I will follow your suggestions and post my findings shortly.
Thanks!
Bo
R
Thank you @mark2catsafe and @david_r, Dynamic Feature Type worked! I used function @GeometryType() as part of the fanout expression.
Please ignore my point #2, I have no idea what I was talking about now that everything is working.
Bo
Not quite. Only line and point geometry types were written to the FGDB. The multi-point type was ignored without warning!
In the image below, the workspace reads from a FFS file containing 21 geometries of various geometry types. Only 6 of them gets created in the resulting FGDB using the dynamic writer, viewed from the Inspector. This behavior seems consistent with the "Save Data As..." command in the Inspector.
I used @david_r's suggestion by creating multilpul feature types each with different geometry type. Then I had to pipe the point features into both Multipoint and Point feature types in the FGDB writer and got the complete set. Thanks!
selection-201.png