斯潘8
span4
由于WorkspaceRunner错误,本文不适用于FME 2018.0。现在已经修复了这个错误,本文将与FME 2018.1或FME 2017.1以及旧版本的FME一起使用。
TheWorkspaceRunnerTransformer在另一个工作区内运行不同的工作区。结合目录和文件路径名阅读器,it can be used as a device for batch processing.
The same technique can be carried out on an FME Server by using theFMEServerJobSubmitter(FMEServerJobSubmitter)transformer in place of the WorkspaceRunner.When publishing a workspace to FME Server that includes a WorkspaceRunner transformer is not recommended.变压器将尝试在FME服务器外启动一个FME实例来运行工作区,这个FME实例需要额外的许可证。
在这个例子中,用户有一个多边形构建工作区,需要在存储在单个文件夹中的多个MIF/MID数据集上使用该工作区。这可以通过创建使用WorkspaceRunner转换器的新工作区来完成。
批处理数据.zip (包含mapinfo mif文件和输出文件夹)
PolygonBuilder.fmw (从mapinfo mif文件构建多边形的工作区1)
WorkspaceRunner.fmw (Workspace 2 that runs Workspace 1 using the WorkspaceRunner)
注:Ensure that you change the reader/writer dataset locations in both the PolygonBuilder.fmw and WorkspaceRunner.fmw to where ever you unzip the BatchProcessingData folder.以及在WorkspaceRunner变压器中。
1.添加mapinfo mif/mid reader
添加一个MapInfo MIF/MIDReader to a blank workspace,for the dataset,select any file from within the folder you are trying to batch process.For this example,add the dataset parcel_k24.mif.Before adding the reader ensure you select Single Merged Feature Type under the 亚搏在线Workflow Options,this will ensure all of the datasets within the folder containing parcel_k24.mif will get processed.After adding the reader to the canvas,go back into the parameters,在“格式属性”选项卡中,enable fme_basename.
MAPINFO MIF/MID读卡器,将工作流选项设置亚搏在线为单个合并的要素类型
mapinfo mif/mid reader参数,在“格式属性”选项卡下,启用FME_basename
2。(可选)添加几何过滤器变压器
The MapInfo MIF files can contain multiple geometry types,for this example,我们只对生产线感兴趣。添加一个GeometryFiltertransformer to the canvas,在参数中,将几何体类型设置为“过滤到线条”。
三。(Optional) Create polygons
既然我们已经筛选了行,we need to connect the lines together to create polygons.添加一个区域生成器transformer to the canvas,在参数中选择要分组的fme_basename,the rest of the parameters can be left as the default.
通过按fme_basename分组创建多边形
4。写入形状文件
添加一个形状文件作家到画布,并将数据集设置为输出文件夹位置。Set the Shapefile Definition to Automatic.当“要素类型”对话框出现时,只需单击“确定”。将Writer连接到AreaBuilder。一旦连接,再次打开参数,this time change the Shapefile Name to fme_basename and the Geometry to Shape_Polygon.
To fanout datasets,set the Shapefile Name to fme_basename
5.保存并关闭工作区
您可以测试运行此工作区,以确保它在您愿意的情况下工作。我们将使用另一个工作区来运行此工作区,所以,for now,你可以把它保存到你能找到的地方,然后关闭它,然后继续工作区2。
PolygonBuilder.fmw workspace,this is the workspace that will be run using the WorkspaceRunner
1.Add a Directory and File Pathnames reader
In a blank workspace,add a目录和文件路径名reader,并将数据集设置为包含要批处理的所有mapinfo mif文件的目录(文件夹)。for this example it will be the Data folder.
使用目录和文件路径名读取器,read the Data folder containing all the MIF files
2。Add a WorkspaceRunner transformer
添加一个WorkspaceRunner变换到画布上。The WorkspaceRunner will run another workspace when the workspace containing it,正在运行。在参数中,set the FME Workspace to the workspace you created in Workspace 1,在本例中,它将是polygonbuilder.fmw。Once you select a workspace,the parameters at the bottom will populate,we will need to change these to ensure they work correctly.Change the Source MapInfo MIF/MID File(s) to the attribute path_windows (note: ensure the WorkspaceRunner is connected to the Directory and File Pathnames Reader to see this parameter).Then change the Destination Esri Shapefile Folder to your output folder.
Set the FME Workspace to PolygonBuilder.fmw,将源MIF文件更改为路径窗口
三。Connect Loggers
To log any errors that might arise with batch processing,right click on the WorkspaceRunner and click Connect伐木工人.Run the workspace and then confirm in your output folder that the files were processed.
工作空间运行器.fmw,with loggers connected to the WorkspaceRunner
WorkspaceRunner.fmw中的转换日志,显示正在polygonBuilder.fmw工作区中转换的一个mif文件。
As the WorkspaceRunner does its stuff,a number of FME processes are started - one for each file.The WorkspaceRunner can be set to wait for each process to complete before starting the next,在这种情况下,一次只能有一个新流程。WorkspaceRunner中有一个参数,用于设置最大并发进程数。This limits the number of concurrently executing workspaces to the value specified.If specified,this parameter value must be an integer in the range 1-7.The specified value includes the process executing WorkspaceRunner.For example,if the value is set to 7 then WorkspaceRunner can only start 6 additional FME processes concurrently.Checking the display in the Task Manager will show the number of executing fme.exe processes.
Windows任务管理器显示运行WorkspaceRunner.fmw工作区时运行的fm.exe的三个实例。
带有已翻译形状文件的输出文件夹示例
Data Attribution
奥斯汀市和特拉维斯县提供的数据,得克萨斯州
FME 2017.0.1.1 (20170512 - Build 17291 - WIN64)
FME Desktop ESRI Edition (floating)
Permanent License.
Machine host name is: WLTS4018
Operating System: Microsoft Windows 7 64-bit Service Pack 1 (Build 7601)
Copyright (c) 1994 - 2017,亚搏在线Safe Software Inc.
亚搏在线Safe Software Inc.
我找不到解决这个错误的方法,希望能得到一些帮助。谢谢您。
© 2019 亚搏在线Safe Software Inc |合法的