Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEFAULT_MACRO WB_CURRENT_CONTEXT
- # -------------------------------------------------------------------------
- Tcl2 proc Creator_CoordSysRemover {} { \
- global FME_CoordSys; \
- set FME_CoordSys {}; \
- }
- MACRO Creator_XML NOT_ACTIVATED
- MACRO Creator_CLASSIC NOT_ACTIVATED
- MACRO Creator_2D3D 2D_GEOMETRY
- MACRO Creator_COORDS <Unused>
- INCLUDE [ if { {Geometry Object} == {Geometry Object} } { \
- puts {MACRO Creator_XML *} } ]
- INCLUDE [ if { {Geometry Object} == {2D Coordinate List} } { \
- puts {MACRO Creator_2D3D 2D_GEOMETRY}; \
- puts {MACRO Creator_CLASSIC *} } ]
- INCLUDE [ if { {Geometry Object} == {3D Coordinate List} } { \
- puts {MACRO Creator_2D3D 3D_GEOMETRY}; \
- puts {MACRO Creator_CLASSIC *} } ]
- INCLUDE [ if { {Geometry Object} == {2D Min/Max Box} } { \
- set comment { \
- We need to turn the COORDS which are \
- minX minY maxX maxY \
- into a full polygon list of coordinates \
- }; \
- set splitCoords [split [string trim {<Unused>}]]; \
- if { [llength $splitCoords] != 4 } { \
- error {Creator: Coordinate List MUST have four numbers - `<Unused>' is invalid}; \
- }; \
- set minX [lindex $splitCoords 0]; \
- set minY [lindex $splitCoords 1]; \
- set maxX [lindex $splitCoords 2]; \
- set maxY [lindex $splitCoords 3]; \
- puts "MACRO Creator_COORDS $minX $minY $minX $maxY $maxX $maxY $maxX $minY $minX $minY"; \
- puts {MACRO Creator_2D3D 2D_GEOMETRY}; \
- puts {MACRO Creator_CLASSIC *} } ]
- FACTORY_DEF $(Creator_XML) CreationFactory \
- FACTORY_NAME Creator_XML_Creator \
- CREATE_AT_END no \
- OUTPUT FEATURE_TYPE _____CREATED______ \
- @Geometry(FROM_ENCODED_STRING,<lt>?xml<space>version=<quote>1.0<quote><space>encoding=<quote>US_ASCII<quote><space>standalone=<quote>no<quote><space>?<gt><lt>geometry<space>dimension=<quote>2<quote><gt><lt>null<solidus><gt><lt><solidus>geometry<gt>)
- FACTORY_DEF $(Creator_CLASSIC) CreationFactory \
- FACTORY_NAME Creator_CLASSIC_Creator \
- $(Creator_2D3D) $(Creator_COORDS) \
- CREATE_AT_END no \
- OUTPUT FEATURE_TYPE _____CREATED______
- FACTORY_DEF * TeeFactory \
- FACTORY_NAME Creator_Cloner \
- INPUT FEATURE_TYPE _____CREATED______ \
- NUMBER_OF_COPIES 1 \
- COPY_NUMBER_ATTRIBUTE "_creation_instance" \
- OUTPUT FEATURE_TYPE Creator_CREATED \
- @Tcl2(Creator_CoordSysRemover) \
- @CoordSys()
- # -------------------------------------------------------------------------
- Tcl2 proc AttributeCreator_963de8ec_aa9a_4bfa_b3a2_dfb262c949840_attrSetter { attrList } { \
- set attrList [string trim $attrList {()}]; \
- set attrs [split $attrList {,} ]; \
- foreach {attrName attrVal} $attrs { \
- if { [string match {*<at>*} $attrName] == 1 } { \
- set attrName [FME_Execute EvaluateExpression {STRING} $attrName {AttributeCreator}]; \
- } else { \
- set attrName [FME_DecodeText $attrName]; \
- }; \
- if { [string match {*<at>*} $attrVal] == 1 } { \
- set attrVal [FME_Execute EvaluateExpression {STRING} $attrVal {AttributeCreator}]; \
- } else { \
- set attrVal [FME_DecodeText $attrVal]; \
- }; \
- FME_SetAttribute $attrName $attrVal; \
- }; \
- };
- FACTORY_DEF * TeeFactory \
- FACTORY_NAME AttributeCreator \
- INPUT FEATURE_TYPE Creator_CREATED \
- OUTPUT FEATURE_TYPE AttributeCreator_OUTPUT \
- "@Tcl2( AttributeCreator_963de8ec_aa9a_4bfa_b3a2_dfb262c949840_attrSetter {(SWIFT_LOAD,10,Permit_License_Date,10)} )"
- # -------------------------------------------------------------------------
- FACTORY_DEF * TestFactory \
- FACTORY_NAME Tester \
- INPUT FEATURE_TYPE AttributeCreator_OUTPUT \
- TEST "@EvaluateExpression(STRING,<at>Evaluate<openparen><at>Value<openparen>SWIFT_LOAD<closeparen>-<at>Value<openparen>Permit_License_Date<closeparen><closeparen>,Tester)" < "30" \
- BOOLEAN_OPERATOR OR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement