span8
斯潘4
Perhaps the most well known GIS operation is to identify whether a point object lies inside or outside of a given polygon.这叫A多边形中的点operation.
例如,一个用户可能有一个代表待售建筑的点的数据集。用户还拥有表示规划限制的多边形数据集,比如保护区,Smoke Control Areas,或限制性契约(关于如何开发土地的协议)。通过在多边形中执行点操作,他们可以确定哪些限制(如果有)适用于特定属性。
FME has several transformers that will carry out this function,但最常用的是PointOnAreaOverlayer。
本例有三个源数据集:一个AutoCAD DWG格式的地块边界矢量线数据集;矢量点数据集(在esri shapefile中)表示城市拥有的属性;以及代表公共艺术作品的非空间数据集(带有经度和纬度列的Excel电子表格)。
In the FME Data Inspector they look like this (above,properties;below,艺术品):
这个例子的场景是,我们希望找出哪个艺术品位于哪个城市的财产上。工作空间将属性线条转换为多边形,and the non-spatial artwork into point features.A point-in-polygon operation will identify which property polygons belong to the city,and a second point-in-polygon operation will identify which city properties contain public works of art.
最后一个操作是将数据写入HTML报告。This is complicated slightly because there may be more than one piece of artwork on a single property and there are several ways of managing this.
1。Start FME Workbench and begin with an empty canvas.从菜单栏中选择“读卡器>添加读卡器”。
将数据格式设置为esri shapefile。Select the attached dataset as the source.This will read the Shapefile dataset that identifies city properties.
2.再次从菜单栏中选择“读卡器>添加读卡器”。This time set the format to Autodesk AutoCAD DWG/DXF and select the attached DWG dataset as the source.单击“确定”之前,打开参数对话框,将分组实体设置为“属性模式”。
This will read the AutoCAD dataset that defines property boundaries.
3.添加一个区域生成器转换器,并将AutoCAD Parcellines功能类型连接到其输入端口。这会将属性边界从线条转换为多边形。
4。添加一个PointOnAreaOverlayer变压器。将CityProperties功能类型连接到其点输入端口,并将AreaBuilder:区域输出端口连接到其区域输入端口:
这将把属性从点特征复制到多边形特征上,where there is an overlap.为了评估是否发生了这种重叠,我们需要检查发生了多少重叠。
5。将测试仪转换器添加到工作区。Connect it to the PointOnAreaOverlayer:Area port:
Open the parameters dialog.Set up a condition to test for where _overlaps is greater than or equal to 1:
这将测试属性边界区域特征,并过滤掉重叠点特征的特征(因此是城市拥有的属性)。
6。Once more select Readers > Add Reader from the menubar.这次将格式设置为Microsoft Excel,并选择附加的XLSX数据集作为源。
单击“确定”之前,打开“参数”对话框并检查预览。You should see there are several sheets in this dataset,and each includes a Longitude and Latitude column that FME identifies as X and Y coordinates:
Back in the main Add Reader dialog,选择工作流选项“单一合亚搏在线并功能类型”。这将确保工作区中的所有工作表都由单个对象表示。
7.向画布中添加一个转发器,并将其连接到新添加的Excel功能类型(标记为
这是必要的,因为Excel值是十进制的,while the rest of the data is in the UTM83-10 coordinate system.打开“重新投影参数”对话框,将其设置为从LL83重新投影到UTM83-10:
8.现在添加第二个PointOnAreaOverlayer。Connect Reprojector:Reprojected to the Point input port and Tester:Passed to the Area input port:
前一个PointOnAreaOverlayer是一个重叠,结果只有一个:属性要么属于城市,要么不属于城市。However,第二个PointOnAreaOverlayer可以有多个结果,because there might be multiple artworks on a single site.
因此,打开第二个PointOnAreaOverlayer的参数对话框。在“属性累积”下,选中标记为“生成列表”的框,然后输入列表名称,如“artlist”:
这将导致特定属性的艺术品保存为名为artlist的FME列表属性。
9。Add a second Tester transformer (or duplicate the first one) and connect it to the second PointOnAreaOverlayer's Area port.再次将其设置为再次测试重叠是否大于或等于1。
Connect an Inspector transformer to this Tester's Passed output port and run the workspace.
The result will be a set of 42 polygons,每件作品都包含公共艺术,并附有这些艺术作品的清单:
10。An FME "list" is a way to have multiple values for a single attribute.不幸的是,this is not a structure that many formats support natively.因此,我们需要以某种方式处理这些值。
Add a ListExploder transformer connected to the Passed port of the second Tester.Open the parameters dialog and under the List Attribute parameter select "ArtList" (or whatever you called the list in step 8).
这是处理列表的一种方法。它从一个具有多个值的特征中“分解”它,多个功能,每个功能都有一个值。
11.Add a HTMLReportGenerator transformer connected to the ListExploder:Elements port:
Open the parameters dialog.We'll set this up to create a report where each property is shown with a list of the artworks that belong to it.
首先将group by参数设置为“property”。This will create a separate report for each property.
Secondly,under Page Contents,默认内容是条形图。Change this to Header and in the Content Settings under Text click the drop-down arrow and choose the Address attribute.将Header Level参数设置为H3。
Now - underneath the Header - add a new Page Contents of type "List".For the settings choose the Title attribute under the List Item Content.
Click OK to close the dialog.
12。最后从菜单栏中选择“编写器>添加编写器”。将格式设置为HTML并指定要写入的文件。Click OK to add the Writer and connect its feature type to the Output port of the HTMLGenerator:
13。重新运行工作区。找到已写入的HTML文件,然后在Web浏览器中打开它。您会发现它显示一个属性列表,each with its own list of artworks:
?2019安全亚搏在线软件公司|Legal