Workspace
The attached workspace takes data from an AutoCAD dataset (railways.dwg) and adds it to the Cambridge database in Smallworld. In this example there are two Smallworld geometries - a railway centre-line and annotation for each line. It is a little more complex to set up than the hard-coded multi-writing example, but pays off with more advantages in the long run.
Screenshot
Points to Note
1) A
Counter is used to create a unique ID for each line feature. The ID will be used later to join line with annotation.
2) A stream of data is routed through a
Labeller to create annotation features for the lines.
3) Instead of exposing and setting the Smallworld geometry names as constants, they are set here as an attribute sworld_name using
AttributeCreators
4) An
Aggregator is used to join each line to its annotation - using the ID number previously defined (group-by = ID). The difference here is that a list is created with the name sworld_geometry - this automatically gives us sword_geometry{0}.sworld_name and sword_geometry{1}.sworld_name by creating the list (sworld_geometry) with the previously defined attributes (sworld_name)
5) As with the other multi-geometry writing, a user attribute "centre_line" has been defined in the destination feature type with a user attribute "annotation" for the label features. These are defined in fme as sworld_chain and sworld_text. This attribute matches the geometry name in Smallworld.
6) Really a non-point! The list format attribute sword_geometry{0}.sworld_name does not need to be exposed or set with a constant. The advantages are that the order of features in the aggregate does not matter (as it did in the
hard-coded multi-writing example) and nor will there be a problem if not each item possesses each type of geometry (eg a line w/o annotation will not cause a traceback).