斯潘8
斯潘4
功能强大的一对-FeatureReader和FeatureWriter(FME 2016中的新功能)-允许将第三方命令行工具简单集成到FME中。
Any tool,任何能阅读的图书馆,以FME支持的格式处理和保存数据可以成为FME工作流程的一部分。亚搏在线为了更好地使用,这样的外部工具可以包装成一个定制的转换器,因此,用户只处理熟悉的FME界面,不需要了解工具所需的任何复杂语法细节。
这种集成的一般工作流亚搏在线如下所示。请注意,可以跳过依赖于工作流的大多数组件(以蓝色显示)。亚搏在线唯一需要的部分是组装命令行并执行它(以红色显示)。
以下是三种最常见的场景:
上面的集成工作流图中的每个步骤都在这里描述。亚搏在线
当用Transformer GUI替换命令行界面时,创建看起来用户友好的参数是有意义的:而不是短选项,使用他们的扩展描述。A "Choice with Alias" user parameter allows showing such descriptions while the parameters get values that can be used directly in the command line.
Here's how such a parameter may look within a command line:
Within the Edit Choice dialog:
and in the transformer's GUI exposed to the user:
Some parameters may need additional processing.例如,we may need to recalculate a normalized color set through the FME "Color Picker" (for example,“1,0.5,0.25”)到RGB24表示(255127,63)。In this case,参数可以通过参数蚀刻器获取,split into R,G,和B部分有属性垃圾,用attributeCreator组装成所需的字符串。有关详细信息,请参阅下面的svgreader。
外部工具的路径可能需要或可能不需要作为参数发布。For using a custom transformer within an organization,it might be better to hide the path from inexperienced users within the command line of the transformer.FME专业人员必须负责安装变压器。If a tool is going to be shared across organizations (through FME Store,例如,it is better to publish the path:
虽然可以使用常规的FME变压器为临时输入和输出文件生成唯一的名称,在tclcaller transformer中使用一个特殊的tcl命令更可靠。命令的语法如下:
fme_tempfilename(文件名)
它在fme temp文件夹中创建一个具有唯一名称的空文件。
例如,如果我们想创建一个使用ImageMagick实用程序的临时文件,我们可以编写以下tcl表达式:
The expression will generate a name similar to this:
C:\Users\username\AppData\Local\Temp\ImageMagick_1453409310204_7104.png
Now this name can be used for making a command line,设置为变压器参数并用一些内容填充文件。
取决于工作流,亚搏在线it may be necessary to save the intermediate files to some temporary location or use the source files directly.例如,when we use LAStools for ground classification,we may first clip the area of interest and classify only this part of the original point cloud.Another example is when the source format is not supported by LAStools.In these cases we need to make the temporary LAS files.
Using the file name reserved with TCL command (see above) and FilenamePartExtractor transformer,我们可以创建指定临时输出数据集路径和文件根名称的属性:
之后,在FeatureWriter中很容易使用这些属性:
命令行可以直接写入SystemCaller Transformer,也可以使用attributeCreator作为属性,然后将在SystemCaller中使用。
命令行应该包括:
下面是几个例子:
“$(imagemagickconvert)”-延迟$(delay)@value(_imagemagick_sequence_file)-循环$(loop)$(gifoutput)”
“$(lastool)”-i“@value(_input)”-o“@value(_lastools_temp_output)”-scale_$(heightstorage scale)$(heightstorage)”
始终确保命令中的路径以及整个命令周围都有双引号-这有助于避免路径中某些字符的潜在问题,比如空间。
在某些情况下,已组装的命令行可能会变得太长,超过允许的限制。On Windows,限制为8192个字符。有几种可能的方法可以解决这个限制。例如,不是在命令行中列出所有文件,可以使用通配符,请参见AnimatedGifWriter示例。Or use shorter names for folders and files by choosing FME_TEMP folder location closer to the root.例如,而不是C:\users\username\appdata\local\temp\,use E:\FME_TEMP\
The assembled command line attribute goes to SystemCaller,which executes the process and waits for results before continuing with other parts of the workspace.外部工具还可以向日志窗口报告作业的状态或错误消息。
一旦外部工具完成其工作并进行一些输出,FME can bring the output back with FeatureReader for further processing.In some cases,可能需要将处理过的数据与原始数据合并。
例如,the point clouds in formats not supported by LAStools may need joining with the processed data for preserving the original components.这可以通过X点云合并来实现,Y,源云和处理过的点云的z。
After the external process finishes,并将数据带回正常的FME工作流程,亚搏在线我们可能需要删除临时文件。It is possible through the OS commands,例如SystemCaller中的“del”,例如:
del "@Value(_lastools_temp_input)" /Q
In some situations when dealing with point clouds and rasters,it is more reliable to issue the following FME command with FMEFunctionCaller:
@几何图形(删除源数据集)
This transformer can be placed right after reading the geometry or later - in any place where the geometry of the feature still exists.The transformer removes the temp file as soon as it is not needed anymore-for example,如果其几何结构在FME工作流程中被破坏或翻译结束。亚搏在线
请注意,应谨慎使用os“del”命令和@geometry(delete_source_dataset)函数,以避免在外部进程使用原始源数据或临时文件之前或期间删除它们。
本文中描述的一般集成工作流不必放入自定义转换器中亚搏在线。Creating such a transformer,however,使外部工具完成的任务更容易与主工作区分离。更容易调试,比整个工作区更新或修改单个自定义转换器,它可能非常大和复杂。通过右键单击自定义转换器并选择“编辑”,可以轻松修改此处显示的所有示例。转换器将在新的工作台选项卡中打开。了解它是如何工作的,您可以随意更改它-添加或删除选项,change the tool performing the transformation,将参数转换成另一种语言,or chain a few tools together into a single transformer if this makes sense in your working environment.
SVG(可缩放矢量图形)是一种XML基于矢量图像格式用于支持交互和动画的二维图形。FME支持写SVG文件,但不是读书。We can read SVG files as rasters usingImageMagick,a free and open-source software suite for displaying,转换,以及编辑光栅图像和矢量图像文件。它可以读取和写入超过200种图像文件格式。
Note that ImageMagick is not a part of FME.You can download your copy of the product from here -http://www.imagemagick.org/
svgreader自定义转换器允许读取一个或多个svg文件,并使用FeatureReader将它们作为RASTER带到FME中。然后可以以任何支持的光栅格式存储光栅。请注意,某些格式可能需要调整其光栅解释(请参见光栅解释强制)。FeatureWriter is not used in this custom transformer.
值得注意的是,我们如何设置背景的颜色和透明度-参数被设置为标准化的FME颜色,然后使用attributeSplitter和attributeCreator更改为imagemagick rgba模型:
“rgba(@evaluate(@floor(@value(0)*255)),@evaluate(@floor(@value(1)*255)),@evaluate(@floor(@value(2)*255)),$(alpha))”
下载模板:svgreader.fmwt
另一个使用ImageMagick的示例。AnimatedGIFWriter expands FME's writing capabilities by adding animated GIF support.
使用FME可以更容易地创建地理参考动画,for example,驾驶地图。
The workspace example shows how to pass the background extents to the moving parts of the animation so a user does not have to calculate the location of the rasterized features in the animation.
自定义转换器使用FeatureWriter将背景和所有动画帧保存到临时PNG文件中。ImageMagick将它们组合成GIF。
FME 2016不支持动画赠品,so it makes no sense to read the file back and display it in Data Inspector.The easiest way to see the animation is through a web browser:
下载模板:Work2HOM.FMWT
流行的板凳software suite is widely used by many organizations for processing LiDAR data.FME 2016,我们做了几个定制变压器,包装了一些最新的工具仪器。
注意,lastools套件不是FME的一部分。您可以从下载您的lastools副本http://rapidlasso.com/.有关定价和许可信息,visithttp://rapidlasso.com/定价/和http://www.cs.unc.edu/~isenburg/lastools/license.txt.
LAStools_lasground_Caller calls lasground.exe,将点分为地面和非地面。
In this example,FeatureWriter is used when the source file was changed before entering the transformer,or the source point cloud format is not supported by LAStools.In these two cases,临时las文件在temp文件夹中创建,laslound.exe在这些文件上运行,否则,它直接与源文件一起工作:
FeatureReader is always used to bring the results generated with lasground.exe back to FME.
此工作流的一个有趣部分是将原始点云与生成的LAS文件合并亚搏在线。如果震源有LAS不支持的组件,在laslound.exe完成工作后,它们将丢失。point cloud合并允许将原始点云与结果按x组合,Y,and Z:
请注意,如果工具更改了其中一个组件,那么XYZ合并将不起作用。
Download LAStools wrapper transformers:lastoolstransformers.zip文件
Download the template (contains the workspace with 5 LAStools wrapper transformers):最新工具demo.fmwt
?2019安全亚搏在线软件公司|合法的