Advertisement
Guest User

Untitled

a guest
Jan 25th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.87 KB | None | 0 0
  1. DEFAULT_MACRO WB_CURRENT_CONTEXT
  2.  
  3. # -------------------------------------------------------------------------
  4.  
  5.  
  6. Tcl2 proc Creator_CoordSysRemover {} { \
  7. global FME_CoordSys; \
  8. set FME_CoordSys {}; \
  9. }
  10.  
  11. MACRO Creator_XML NOT_ACTIVATED
  12.  
  13. MACRO Creator_CLASSIC NOT_ACTIVATED
  14.  
  15. MACRO Creator_2D3D 2D_GEOMETRY
  16.  
  17. MACRO Creator_COORDS <Unused>
  18.  
  19. INCLUDE [ if { {Geometry Object} == {Geometry Object} } { \
  20. puts {MACRO Creator_XML *} } ]
  21.  
  22. INCLUDE [ if { {Geometry Object} == {2D Coordinate List} } { \
  23. puts {MACRO Creator_2D3D 2D_GEOMETRY}; \
  24. puts {MACRO Creator_CLASSIC *} } ]
  25.  
  26. INCLUDE [ if { {Geometry Object} == {3D Coordinate List} } { \
  27. puts {MACRO Creator_2D3D 3D_GEOMETRY}; \
  28. puts {MACRO Creator_CLASSIC *} } ]
  29.  
  30. INCLUDE [ if { {Geometry Object} == {2D Min/Max Box} } { \
  31. set comment { \
  32. We need to turn the COORDS which are \
  33. minX minY maxX maxY \
  34. into a full polygon list of coordinates \
  35. }; \
  36. set splitCoords [split [string trim {<Unused>}]]; \
  37. if { [llength $splitCoords] != 4 } { \
  38. error {Creator: Coordinate List MUST have four numbers - `<Unused>' is invalid}; \
  39. }; \
  40. set minX [lindex $splitCoords 0]; \
  41. set minY [lindex $splitCoords 1]; \
  42. set maxX [lindex $splitCoords 2]; \
  43. set maxY [lindex $splitCoords 3]; \
  44. puts "MACRO Creator_COORDS $minX $minY $minX $maxY $maxX $maxY $maxX $minY $minX $minY"; \
  45. puts {MACRO Creator_2D3D 2D_GEOMETRY}; \
  46. puts {MACRO Creator_CLASSIC *} } ]
  47.  
  48. FACTORY_DEF $(Creator_XML) CreationFactory \
  49. FACTORY_NAME Creator_XML_Creator \
  50. CREATE_AT_END no \
  51. OUTPUT FEATURE_TYPE _____CREATED______ \
  52. @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>)
  53.  
  54. FACTORY_DEF $(Creator_CLASSIC) CreationFactory \
  55. FACTORY_NAME Creator_CLASSIC_Creator \
  56. $(Creator_2D3D) $(Creator_COORDS) \
  57. CREATE_AT_END no \
  58. OUTPUT FEATURE_TYPE _____CREATED______
  59.  
  60. FACTORY_DEF * TeeFactory \
  61. FACTORY_NAME Creator_Cloner \
  62. INPUT FEATURE_TYPE _____CREATED______ \
  63. NUMBER_OF_COPIES 1 \
  64. COPY_NUMBER_ATTRIBUTE "_creation_instance" \
  65. OUTPUT FEATURE_TYPE Creator_CREATED \
  66. @Tcl2(Creator_CoordSysRemover) \
  67. @CoordSys()
  68.  
  69.  
  70. # -------------------------------------------------------------------------
  71.  
  72.  
  73. Tcl2 proc AttributeCreator_963de8ec_aa9a_4bfa_b3a2_dfb262c949840_attrSetter { attrList } { \
  74. set attrList [string trim $attrList {()}]; \
  75. set attrs [split $attrList {,} ]; \
  76. foreach {attrName attrVal} $attrs { \
  77. if { [string match {*<at>*} $attrName] == 1 } { \
  78. set attrName [FME_Execute EvaluateExpression {STRING} $attrName {AttributeCreator}]; \
  79. } else { \
  80. set attrName [FME_DecodeText $attrName]; \
  81. }; \
  82. if { [string match {*<at>*} $attrVal] == 1 } { \
  83. set attrVal [FME_Execute EvaluateExpression {STRING} $attrVal {AttributeCreator}]; \
  84. } else { \
  85. set attrVal [FME_DecodeText $attrVal]; \
  86. }; \
  87. FME_SetAttribute $attrName $attrVal; \
  88. }; \
  89. };
  90.  
  91.  
  92. FACTORY_DEF * TeeFactory \
  93. FACTORY_NAME AttributeCreator \
  94. INPUT FEATURE_TYPE Creator_CREATED \
  95. OUTPUT FEATURE_TYPE AttributeCreator_OUTPUT \
  96. "@Tcl2( AttributeCreator_963de8ec_aa9a_4bfa_b3a2_dfb262c949840_attrSetter {(SWIFT_LOAD,10,Permit_License_Date,10)} )"
  97.  
  98.  
  99. # -------------------------------------------------------------------------
  100.  
  101.  
  102. FACTORY_DEF * TestFactory \
  103. FACTORY_NAME Tester \
  104. INPUT FEATURE_TYPE AttributeCreator_OUTPUT \
  105. TEST "@EvaluateExpression(STRING,<at>Evaluate<openparen><at>Value<openparen>SWIFT_LOAD<closeparen>-<at>Value<openparen>Permit_License_Date<closeparen><closeparen>,Tester)" < "30" \
  106. BOOLEAN_OPERATOR OR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement