Geometry Representation
As mentioned in the earlier sections, SEF features can have very complex geometry types. Within each feature lies many components. In order to handle the geometry inside of each component, the SEF writer requires all geometry attributes associated with coordinates to be stored in the FME geometry of the SEF feature. The SEF writer expects all SEF features to be aggregates if they have more than one graphical component. As a rule of thumb, if there is more than one graphical component with a feature, the feature must be aggregated together.
For example, if we were to construct a two-point line with user-defined attributes, since the feature contains one geometry component, we can do either of the following:
The two components are constructed using the sef_component{} list structure. Through this, the user can control exactly which component sections the attributes fall into.
FACTORY_DEF * CreationFactoy \ 2D_GEOMETRY 1 1 2 2 \ CREATE_AT_END \ NUMBER_TO_CREATE 1 \ OUTPUT FEATURE_TYPE feat \ sef_component{0}.sef_type sef_line \ sef_component{0}.streetName "Dow St" \ sef_component{0}.sef_lbl lineComponent \ sef_component{1}.sef_type sef_nongraphic \ sef_component{1}.streetNumber 6th \ sef_component{1}.sef_lbl ngComponent
The resulting feature to the output file is:
feat { lbl="feat"; st=""; cmp { lbl="lineComponent"; typ=line; att { streetName="Dow St"; } /* att section */ geo { fst_pnt=1,1; snd_pnt=2,2; } /* geo section */ } /* cmp section */ cmp { lbl="ngComponent"; typ=n_g; att { streetNumber="6th"; }/* att section */ } /* cmp section */ } /* feat */
Only the graphical component (the two-point line) is specified. All other user-defined attributes will automatically fall into the component section preceding the graphical component section.
FACTORY_DEF * CreationFactory \ 2D_GEOMETRY 1 1 2 2 \ CREATE_AT_END \ NUMBER_TO_CREATE 1 \ OUTPUT FEATURE_TYPE feat \ sef_type sef_line \ sef_lbl lineComponent \ streetName "Dow St" \ streetNumber 6th
The resulting feature to the output file is:
feat { lbl="feat"; st=""; cmp { lbl="ngComponent"; typ=n_g; att { streetNumber="6th"; streetName="Dow St"; } /* att section */ } /* cmp section */ cmp { lbl="ngComponent"; typ=line; geo { fst_pnt=1,1; snd_pnt=2,2; }/* geo section */ } /* cmp section */ } /* feat */
If we were to construct a feature with more than one geometry component (for instance, a curve and a complex line), we would have to use an AggregateFactory to aggregate the different geometries together:
# A curve. FACTORY_DEF * CreationFactory \ 2D_GEOMETRY 1 1 2 2 3 3 4 4 \ CREATE_AT_END \ NUMBER_TO_CREATE 1 \ OUTPUT FEATURE_TYPE aggregate3 \ sef_type sef_curve \ roadname 1st # A two point line forced into a complex # string. FACTORY_DEF * CreationFactory \ 2D_GEOMETRY 1 1 2 2 \ CREATE_AT_END \ NUMBER_TO_CREATE 1 \ OUTPUT FEATURE_TYPE aggregate3 \ sef_type sef_line \ sef_element_type 12 \ signnumber 4 # Aggregate factory to aggregate the curve # and the complex string together. FACTORY_DEF * AggregateFactory \ INPUT FEATURE_TYPE aggregate3 \ LIST_NAME sef_component{} \ OUTPUT AGGREGATE FEATURE_TYPE aggregate3
The resulting feature to the output file would be:
feat { lbl="aggregate3"; st=""; cmp { lbl=""; typ=crv; att { roadname="1st"; } /* att section */ geo { num_pnts=4; pnts=1,1 : 2,2 : 3,3 : 4,4; } /* geo section */ } /* cmp section */ cmp { lbl=""; typ=cplx_str; att { signnumber="4"; elm_cnt=1; } /* att section */ subtype=str; { geo { num_pnts=2; pnts=1,1 : 2,2; } /* geo section */ } /* subtype section */ } /* cmp section */ } /* feat */