span8
span4
span8
span4
With FME Server and FME Desktop, we can use an area of interest polygon (e.g. a city boundary) to clip a set of user-specified layers that fall within it This is different than the more traditional approach of reading the entire set of layers and then clipping the features.
To perform this task, the FeatureReader transformer will be used. This transformer lets us use any format and actually allows for spatial filters to be applied to the user-specified layer.
As well, the FeatureReader allows you to write data dynamically into destination feature types for any table that it reads. This happens via a
The following is a step-by-step guide. See the attached workspace for a finished example.
This is the feature that will be used to filter our desired data spatially. All features that are found within this boundary will be read into the workflow.
一个新的Mapinfo标签阅读器添加到画布上。
格式:MapInfo的TAB(MITAB)
数据集:
此选项将允许最终用户的灵活性,让他们选择基于他们选择的区域类型(例如,工业与住宅)不同的边界。在Navigator,在公布的参数点击右键并选择“添加参数”。创建一个新的“选择”参数与MapInfo的文件中导入的区域类型。
一个)Right click on Published Parameters in the Navigator and select 'Add'. Enter the following:
b)Click on the Configuration button and choose 'Import' on the following screen:
c)读取区.tab文件和设置导入模式:
点击下一步'。
Click 'Import' to bring in the Categories.
选择“确定”保存参数。
Extra Credit
使用网络映射工具:如果您的用户正在绘制的某种网络映射工具感兴趣的区域,可以将这个多边形的顶点发送到一个新发布的参数,然后建立创造者和组合这些顶点的多边形的变压器。
Using Where Clause: If your users are selecting the area of interest by adding a reader, you could publish a Where Clause for that reader (if applicable for the format) to provide the user flexibility. (in our example, Mapinfo does not have this functionality so we must create a parameter)
这两种方法可以以上在单个工作空间被组合,给用户带来任一选项。
Each zone category in the zones dataset is made up of multiple polygons. As we want to use a single zone as a boundary, we need a way to aggregate these features into an organized feature. To do this, we will use the Dissolver, Aggregator and Tester transformers.
一个)将溶解器连接到MITAB阅读器和设置以下的画布上:
Group By: ZoneCategory
b)添加聚合:
Group By: ZoneCategory
c)Add a Tester using our published parameter (TYPE):
左值:ZoneCategory操作:=权的价值:$(TYPE)
At this stage, we will read the actual data layers that we are interested in and which will be written out via a writer. This is the data that we want to be filtered by the boundary polygon.
Add a FeatureReader to the Canvas and connect it to the Tester. Then set the following:
格式: PostGIS
数据集:嵌入连接参数
PostGIS的凭据:
主办 | postgis.train.safe.com |
Port | 5432 |
数据库 | fmedata |
用户 | fmedata |
Password | fmedata |
Feature Types to Read:public.Parks(键入上述内容,或使用“...”按钮进行搜索)
空间滤波器: Contains
Output > Output Ports:单个输出端口
输出>属性和几何处理> <通用端口>>属性揭露:fme_feature_type
Select 'Ok'.
运行工作空间,检查输出。你应该注意到,只有你所选择的边界面遗迹内部存在的园区数据。在这个阶段,只有公园将被读入工作区,所以我们可以通过给用户层的选择,提高了灵活性。
要做到这一点,要创建第二个公布的参数需要允许用户选择他们想要的层(即功能类型)。在FeatureReader,选择旁边的下拉箭头,以“特征类型”,选择“用户参数>添加用户配置”,然后选择固定列表,从存储在数据库层的选择。选择:“public.Roads,public.Parks和public.AddressPoints”,然后选择“确定”创建参数。
Extra Credit
You can also create the parameter as a text field. A text field allows options to be entered that didn't exist when the workspace was authored; they need to be manually input or passed in via another program such as a web application that uses FME Server. You will send the user's choices to this parameter as a space-delimited list. For example: “AddressPoints Parcels Neighborhoods”.
由于工作区是它可以读取相当灵活,笔者将需要建立在动态模式下,以确保数据可以写出来。
通用作家加入到画布上,并选择“欧特克AutoCAD的DWG / DXF”的格式中的参数使用。当工作区运行,您可以将其更改为提示,当你喜欢的任何格式(强大!)。
Note:工作区将随着工作的文件和文件夹基于格式。对于其他格式,例如基于云和数据库,有必要设置其他作家参数,来指定并连接到期望的目的地。
通用格式允许用户有格式的选择。然后将模式设置为动态和模式源为“模式从模式功能”。
为了写啊ut data in FME, the writer feature type needs to know the schema that it will use. In this case we need to use the data from the FeatureReader as our schema.
我们怎样才能模式?
正如2015年FME的FeatureReader有一个附加的输出端口“<架构>”。该端口将提供的模式特征,其表示每个组的特征的布局。架构和通用端口(包含我们的数据)连接到作家。
Note:要使用固定的架构模式(在本例中未显示),你将需要添加一个作家和目标要素类型的任何表的用户可能读取。使用FeatureTypeFilter变压器路由功能,以适当的目标要素类型。
现在使用的提示和运行选项执行的工作区。尝试不同的区域类型和表名,以产生不同组的输出。
What is happening is that the FeatureReader transformer is triggered by the Initiator feature. In our case, this is the set of bounding polygons of Zone data. If we have 10 bounding polygons then the FeatureReader is executed 10 times. Performance is best if there are fewer Initiator features.
当FeatureReader启动它连接到格式并读取表名参数中指定的要素类型。变压器允许空间滤波所以使用“包含”条款意味着返回的功能由发起多边形遏制。然后笔者动态通吃的特性,并将其写入基于传入层名称和架构各自的层。落在我们的边界框之外的任何功能不包括在内。
Performing spatial queries on database tables using the FeatureReader
Performing native spatial queries on database tables using the SQLExecutor
Point in Polygon Calculations with the PointOnAreaOverlayer
Extract Geodatabase Coded Domain Definitions
使用InlineQuerier为多个FeatureMergers更换
Using the SQLExecutor or SQLCreator to issue commands to a database
© 2020 Safe Software Inc |Legal