Guest User

Run32bit in 64bit

a guest
Jun 28th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.35 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. set trimmedCoords {}; \
  39. foreach item $splitCoords { if { $item != {} } {lappend trimmedCoords $item} }; \
  40. set splitCoords $trimmedCoords; \
  41. }; \
  42. if { [llength $splitCoords] != 4 } { \
  43. error {Creator: Coordinate List MUST have four numbers - `<Unused>' is invalid}; \
  44. }; \
  45. set minX [lindex $splitCoords 0]; \
  46. set minY [lindex $splitCoords 1]; \
  47. set maxX [lindex $splitCoords 2]; \
  48. set maxY [lindex $splitCoords 3]; \
  49. puts "MACRO Creator_COORDS $minX $minY $minX $maxY $maxX $maxY $maxX $minY $minX $minY"; \
  50. puts {MACRO Creator_2D3D 2D_GEOMETRY}; \
  51. puts {MACRO Creator_CLASSIC *} } ]
  52.  
  53. FACTORY_DEF $(Creator_XML) CreationFactory \
  54. FACTORY_NAME Creator_XML_Creator \
  55. CREATE_AT_END no \
  56. OUTPUT FEATURE_TYPE _____CREATED______ \
  57. @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>)
  58.  
  59. FACTORY_DEF $(Creator_CLASSIC) CreationFactory \
  60. FACTORY_NAME Creator_CLASSIC_Creator \
  61. $(Creator_2D3D) $(Creator_COORDS) \
  62. CREATE_AT_END no \
  63. OUTPUT FEATURE_TYPE _____CREATED______
  64.  
  65. FACTORY_DEF * TeeFactory \
  66. FACTORY_NAME Creator_Cloner \
  67. INPUT FEATURE_TYPE _____CREATED______ \
  68. NUMBER_OF_COPIES 1 \
  69. COPY_NUMBER_ATTRIBUTE "_creation_instance" \
  70. OUTPUT FEATURE_TYPE Creator_CREATED \
  71. @Tcl2(Creator_CoordSysRemover) \
  72. @CoordSys() \
  73. fme_feature_type Creator
  74.  
  75.  
  76. # -------------------------------------------------------------------------
  77.  
  78.  
  79. FACTORY_DEF * TeeFactory \
  80. FACTORY_NAME SystemCaller \
  81. INPUT FEATURE_TYPE Creator_CREATED \
  82. OUTPUT FEATURE_TYPE SystemCaller_OUTPUT \
  83. @System(LOG_PREFIX,SystemCaller,ENCODED,<quote>C:<backslash>Program<space>Files<space><openparen>x86<closeparen><backslash>FME_2013<backslash>fme.exe<quote><space>C:<backslash>Apps<backslash>FMEServer<backslash>Clients<backslash>DemoWorkspaces<backslash>easyTranslator.fmw<space>--SourceDataset_GENERIC<space>C:<backslash>temp<backslash>demo.shp<space>--SourceFormat<space>GUESS_FROM_EXTENSION<space>--COORDSYS<space>EPSG:25833<space>--GENERIC_OUT_BASE_NAME_GENERIC<space>translated_data<space>--DestinationFormat<space>ACAD<space>--COORDSYS_Dest<space>EPSG:25833)
  84.  
  85.  
  86. # -------------------------------------------------------------------------
  87.  
  88.  
  89. # Set the directive to add all the meta-attributes to the features.
  90.  
  91. # We do this so users see all possible information in the viewed
  92.  
  93. # features.
  94.  
  95.  
  96. READER_META_ATTRIBUTES fme_feature_type fme_dataset fme_basename
  97.  
  98. # Assumption is that the workspace temp dir has been already set and created. See controldefs.cpp - ControlDefs::writeVisualizerTempDir
  99.  
  100. DEFAULT_MACRO WORKSPACE_TEMP_DIR
  101.  
  102. INCLUDE [ \
  103. if { [string length {}] > 0 } { \
  104. set catter "" ; \
  105. set comma "" ; \
  106. foreach attr {} { \
  107. set catter "$catter$comma@Value(\"$attr\")" ; \
  108. set comma ",_," ; \
  109. } ; \
  110. puts "MACRO CATMAC _@Concatenate($catter)" ; \
  111. } \
  112. else { \
  113. puts "MACRO CATMAC " ; \
  114. }; \
  115. set safeName "[regsub -all {[^a-zA-Z0-9]} {SystemCaller_OUTPUT} _]_[expr round(rand() * 1000000)]_[clock clicks -milliseconds]"; \
  116. puts "MACRO SAFE_FFS_NAME $safeName"; \
  117. ]
  118.  
  119. # Make the temporary directory that the FFS files will live in.
  120.  
  121. FACTORY_DEF * CreationFactory \
  122. FACTORY_NAME SystemCaller_OUTPUT_DirCreator \
  123. OUTPUT FEATURE_TYPE __nukeme__ \
  124. @Tcl2("catch {file mkdir {$(WORKSPACE_TEMP_DIR)}}")
  125.  
  126. FACTORY_DEF * TeeFactory \
  127. FACTORY_NAME SystemCaller_OUTPUT_DirCreatorCleanerUpper \
  128. INPUT FEATURE_TYPE __nukeme__
  129.  
  130. # Send raster, point cloud and vector features down different paths to prepare
  131.  
  132. # them for viewing
  133.  
  134.  
  135. FACTORY_DEF * TestFactory \
  136. FACTORY_NAME SystemCaller_OUTPUT_FeatureDirector \
  137. INPUT FEATURE_TYPE SystemCaller_OUTPUT \
  138. TEST &fme_type == "fme_raster" \
  139. OUTPUT FAILED FEATURE_TYPE SystemCaller_OUTPUT___NotRasterFeatures___ \
  140. OUTPUT PASSED FEATURE_TYPE SystemCaller_OUTPUT___RasterFeatures___
  141.  
  142. FACTORY_DEF * TestFactory \
  143. FACTORY_NAME SystemCaller_OUTPUT___FeatureDirector1 \
  144. INPUT FEATURE_TYPE SystemCaller_OUTPUT___NotRasterFeatures___ \
  145. TEST &fme_type == "fme_point_cloud" \
  146. OUTPUT FAILED FEATURE_TYPE SystemCaller_OUTPUT___VectorFeatures___ \
  147. OUTPUT PASSED FEATURE_TYPE SystemCaller_OUTPUT___PointCloudFeatures___
  148.  
  149. # Vector features simply may get their colors overridden
  150.  
  151.  
  152. FACTORY_DEF * TeeFactory \
  153. FACTORY_NAME SystemCaller_OUTPUT_VectorSetterUpper \
  154. INPUT FEATURE_TYPE SystemCaller_OUTPUT___VectorFeatures___ \
  155. OUTPUT FEATURE_TYPE __viewme__
  156.  
  157. # Point Cloud Features Might Need to be thinned
  158.  
  159.  
  160. # Note that we don't call the ThinPointCloud function directly, but rather
  161.  
  162. # do it through TCL. This should allow this transformer to be used with a
  163.  
  164. # Desktop license, even though ThinPointCloud requires Professional.
  165.  
  166.  
  167. Tcl2 proc SystemCaller_OUTPUT_884b7043_e265_4342_a8db_e6e81ac06a2f2_thinPointCloud {} { \
  168. if {[string equal {NO_THINNING} {KEEPNPOINT}]} \
  169. { \
  170. FME_Execute ThinPointCloud NO_THINNING <Unused>; \
  171. } \
  172. elseif {[string equal {NO_THINNING} {MAXNUMPOINTS}]} \
  173. { \
  174. FME_Execute ThinPointCloud NO_THINNING <Unused>; \
  175. } \
  176. elseif {[string equal {NO_THINNING} {FIRSTNPOINTS}]} \
  177. { \
  178. FME_Execute ThinPointCloud NO_THINNING <Unused>; \
  179. } \
  180. elseif {[string equal {NO_THINNING} {LASTNPOINTS}]} \
  181. { \
  182. FME_Execute ThinPointCloud NO_THINNING <Unused>; \
  183. }; \
  184. }
  185.  
  186. FACTORY_DEF * TeeFactory \
  187. FACTORY_NAME SystemCaller_OUTPUT___PointCloudThinner \
  188. INPUT FEATURE_TYPE SystemCaller_OUTPUT___PointCloudFeatures___ \
  189. OUTPUT FEATURE_TYPE __viewme__ \
  190. @Tcl2("SystemCaller_OUTPUT_884b7043_e265_4342_a8db_e6e81ac06a2f2_thinPointCloud")
  191.  
  192. Tcl2 proc SystemCaller_OUTPUT_884b7043_e265_4342_a8db_e6e81ac06a2f2_prepareRaster {subsetStartRow subsetNumRows subsetStartCol subsetNumCols} { \
  193. set useDI [string equal -nocase {$(FME_VIEWER_APP)} {fmedatainspector}]; \
  194. if {!$useDI} { \
  195. FME_Execute ApplyRasterRotation BILINEAR; \
  196. }; \
  197. set doResample [string equal {NoReduction} {Resample}]; \
  198. set doSubset [string equal {NoReduction} {Subset}]; \
  199. set doBounds [string equal {NoReduction} {BoundingBoxOnly}]; \
  200. if {$doBounds} { \
  201. FME_Execute GeometryType fme_polygon; \
  202. } \
  203. elseif {$doResample || $doSubset} { \
  204. set comment { \
  205. First, we need to prefix all the attributes. This is done because \
  206. we are going to call @RasterProperties, and we want to make sure \
  207. it doesn't overwrite any existing attributes. \
  208. }; \
  209. set kAttrPrefix "."; \
  210. set allNames [FME_AttributeNames]; \
  211. foreach oldName $allNames { \
  212. set newName $kAttrPrefix; \
  213. append newName $oldName; \
  214. FME_RenameAttribute $newName $oldName; \
  215. }; \
  216. FME_Execute RasterProperties RASTER; \
  217. if {$doResample} { \
  218. set oldNumCols [FME_GetAttribute _num_columns]; \
  219. set oldNumRows [FME_GetAttribute _num_rows]; \
  220. set oldSpacingX [FME_GetAttribute _spacing_x]; \
  221. set oldSpacingY [FME_GetAttribute _spacing_y]; \
  222. set kMinNumCells 32; \
  223. set kMaxNumCells 512; \
  224. set comment { \
  225. We will only resample if both dimensions are greater than the \
  226. minimum num cells, and at least one is greater than the maximum. \
  227. }; \
  228. if {$oldNumRows > $kMinNumCells && $oldNumCols > $kMinNumCells && ($oldNumRows > $kMaxNumCells || $oldNumCols > $kMaxNumCells)} { \
  229. set newSpacingX 1.0; \
  230. set newSpacingY 1.0; \
  231. if {$oldNumRows > $oldNumCols} { \
  232. set comment { \
  233. If we have more rows than columns, we need to choose a spacing \
  234. that reduces the number of rows to the maximum we've chosen. \
  235. }; \
  236. set newSpacingY [expr 1.0 * $oldNumRows * $oldSpacingY / $kMaxNumCells]; \
  237. set newSpacingX [expr 1.0 * $newSpacingY / $oldSpacingY * $oldSpacingX]; \
  238. set comment { \
  239. Now we need to check if doing this will result in the columns \
  240. going below the minimum. If so, choose the spacing such that \
  241. we only go down to the minimum (and not past). \
  242. }; \
  243. set newNumCols [expr $oldNumCols * $oldSpacingX / $newSpacingX]; \
  244. if {$newNumCols < $kMinNumCells} \
  245. { \
  246. set newSpacingX [expr 1.0 * $oldNumCols * $oldSpacingX / $kMinNumCells]; \
  247. set newSpacingY [expr 1.0 * $newSpacingX / $oldSpacingX * $oldSpacingY]; \
  248. }; \
  249. } \
  250. else { \
  251. set comment { \
  252. This is identical to the above case, except the roles of \
  253. rows and cols are reversed. \
  254. }; \
  255. set newSpacingX [expr 1.0 * $oldNumCols * $oldSpacingX / $kMaxNumCells]; \
  256. set newSpacingY [expr 1.0 * $newSpacingX / $oldSpacingX * $oldSpacingY]; \
  257. set newNumRows [expr $oldNumRows * $oldSpacingY / $newSpacingY]; \
  258. if {$newNumRows < $kMinNumCells} \
  259. { \
  260. set newSpacingY [expr 1.0 * $oldNumRows * $oldSpacingY / $kMinNumCells]; \
  261. set newSpacingX [expr 1.0 * $newSpacingY / $oldSpacingY * $oldSpacingX]; \
  262. }; \
  263. }; \
  264. FME_Execute ResampleRaster CELL_SIZE $newSpacingX $newSpacingY NearestNeighbor; \
  265. }; \
  266. } \
  267. elseif {$doSubset} { \
  268. set comment { \
  269. Get the value of some strings that may be attributes or constants. \
  270. Note that we pass in the attribute prefix we're using, because if \
  271. one does turn out to be an attribute, it won't actually be the exact \
  272. name in the string (since we renamed all our attributes above). \
  273. }; \
  274. set rasterNumRows [FME_GetAttribute _num_rows]; \
  275. set rasterNumCols [FME_GetAttribute _num_columns]; \
  276. set comment { \
  277. Only do subsetting if the specified start position is actually \
  278. within the raster. \
  279. }; \
  280. if {$subsetStartRow < $rasterNumRows && $subsetStartCol < $rasterNumCols} \
  281. { \
  282. set comment { \
  283. Now bound the subset to the size of the raster, so that \
  284. we don't create padding. \
  285. }; \
  286. if {[expr $subsetStartRow + $subsetNumRows] > $rasterNumRows} \
  287. { \
  288. set subsetNumRows [expr $rasterNumRows - $subsetStartRow]; \
  289. }; \
  290. if {[expr $subsetStartCol + $subsetNumCols] > $rasterNumCols} \
  291. { \
  292. set subsetNumCols [expr $rasterNumCols - $subsetStartCol]; \
  293. }; \
  294. FME_Execute SubsetRaster $subsetStartRow $subsetNumRows $subsetStartCol $subsetNumCols; \
  295. }; \
  296. }; \
  297. set comment { \
  298. Remove all the attributes added by @RasterProperties and remove the \
  299. prefix from the real attributes. We assume they all start with an \
  300. underscore. \
  301. }; \
  302. FME_Execute RemoveAttributes fme_regexp_match {^_}; \
  303. foreach oldName $allNames { \
  304. set newName $kAttrPrefix; \
  305. append newName $oldName; \
  306. FME_RenameAttribute $oldName $newName; \
  307. }; \
  308. }; \
  309. }
  310.  
  311. FACTORY_DEF * TeeFactory \
  312. FACTORY_NAME SystemCaller_OUTPUT_RasterSetterUpper \
  313. INPUT FEATURE_TYPE SystemCaller_OUTPUT___RasterFeatures___ \
  314. OUTPUT FEATURE_TYPE __viewme__ \
  315. @Tcl2("SystemCaller_OUTPUT_884b7043_e265_4342_a8db_e6e81ac06a2f2_prepareRaster {<Unused>} {<Unused>} {<Unused>} {<Unused>}")
  316.  
  317. # Now route all the features into the recorder, changing their
  318.  
  319. # feature type to the transformer name so that they view nicely
  320.  
  321. # SystemCaller_OUTPUT_884b7043_e265_4342_a8db_e6e81ac06a2f2_VIS_FEAT_TYPE changes the feature types
  322.  
  323. # of the features being visualized.
  324.  
  325.  
  326. DEFAULT_MACRO SystemCaller_OUTPUT_884b7043_e265_4342_a8db_e6e81ac06a2f2_VIS_FEAT_TYPE SystemCaller_OUTPUT$(CATMAC)
  327.  
  328. DEFAULT_MACRO VISUALIZER_FEATURE_FILE $(WORKSPACE_TEMP_DIR)/$(SAFE_FFS_NAME).ffs
  329.  
  330. DEFAULT_MACRO VISUALIZER_CREATE_SPATIAL_INDEX NO
  331.  
  332. # [PR#45549] The Data Inspector will limit the maximum number of features
  333.  
  334. # it reads on WIN32, so we will correspondingly limit the number of
  335.  
  336. # features we record here using the MAX_FEATURES_TO_RECORD directive.
  337.  
  338.  
  339. FACTORY_DEF * RecorderFactory \
  340. FACTORY_NAME SystemCaller_OUTPUT_Recorder \
  341. INPUT FEATURE_TYPE __viewme__ _wb_termination_feature Yes @FeatureType(TERMINATOR_@Value(_wb_termination_xformer)) \
  342. INPUT FEATURE_TYPE __viewme__ @FeatureType($(SystemCaller_OUTPUT_884b7043_e265_4342_a8db_e6e81ac06a2f2_VIS_FEAT_TYPE)) \
  343. FEATURE_FILE "$(VISUALIZER_FEATURE_FILE)" \
  344. CREATE_SPATIAL_INDEX "$(VISUALIZER_CREATE_SPATIAL_INDEX)" \
  345. INSPECTOR "$(VISUALIZER_CREATE_SPATIAL_INDEX)" \
  346. FSC_SCHEMA _creation_instance,varchar<openparen>255<closeparen> \
  347. MODE RECORD \
  348. RECORD_DIRECTLY_TO_DISK YES \
  349. MAX_FEATURES_TO_RECORD WIN32 2000000
Advertisement
Add Comment
Please, Sign In to add comment