span8
span4
也许最知名的GIS操作,以确定给定的多边形是否一个点对象位于内侧或外侧。这就是所谓的Point in Polygon操作。
例如,一个用户可能有表示正在销售的建筑点的数据集。用户还可以代表规划限制,如保护区多边形的数据集,烟控制区,或限制性条款(在陆地上如何开发协议)。通过进行多边形操作的时候,他们可以决定哪些限制 - 如果有的话 - 适用于特定的属性。
FME有几个变压器,将执行此功能,但最常用的是PointOnAreaOverlayer。
这有例如三个源数据集:在AutoCAD DWG格式包裹边界的矢量线数据集;矢量点数据集(在ESRI的shapefile)表示由城市拥有的性能;和非空间数据集(Excel电子表格与纬度和经度列)代表公共艺术品。
在FME数据查验它们看起来像这样(以上,性能;下面,艺术品):
这个例子的情况是,我们希望找出哪些作品是位于哪个城市性质。工作区将会把属性线条成多边形和非空间艺术品入点的特征。一个点在多边形的操作将确定哪个属性多边形属于城市,第二点在多边形的操作将确定哪个城市属性包含艺术的公共工程。
最后一个操作是将数据写入到一个HTML报告。这是稍微复杂的,因为有可能是在一个单一的财产多于一件艺术品,并有管理这几种方式。
1。启动FME工作台,并开始与一个空白的画布。选择读者>从菜单栏中添加读卡器。
将数据格式设置到ESRI Shape文件。选择附加数据集作为源。这将读取的Shapefile数据集标识的城市性质。
2。再次选择读者>从菜单栏中添加读卡器。此时设置的格式到Autodesk AutoCAD的DWG / DXF,并选择连接DWG数据集作为源。单击确定之前,打开参数对话框,设置组3520到“属性模式”。
这将会读取AutoCAD的数据集定义属性的边界。
3。添加一个Aut AreaBuilder变压器和连接oCAD ParcelLines feature type to its input port.This will convert the property boundaries from lines into polygons.
4.Add a PointOnAreaOverlayer transformer.Connect the CityProperties feature type to its Point input port and the AreaBuilder:Area output port to its Area input port:
This will copy attributes from point features onto polygon features, where there is an overlap.To assess if that overlap has taken place, we need to check how many overlaps took place.
5.Add a Tester transformer to the workspace.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:
This will test the property boundary area features and filter out the ones that overlapped a point feature (and are therefore a city-owned property).
6.Once more select Readers > Add Reader from the menubar.This time set the format to Microsoft Excel and select the attached xlsx dataset as the source.
Before clicking OK, open the parameters dialog and check the preview.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, select the Workflow Option "Single Merged Feature Type".This will ensure that all sheets are represented by a single object in the workspace.
7.Add a Reprojector transformer to the canvas and connect it to the newly added Excel feature type (labelled
This is necessary because the Excel values are in decimal degrees, while the rest of the data is in the UTM83-10 coordinate system.Open the Reprojector parameters dialog and set it up to reproject from LL83 to UTM83-10:
8.Now add a second PointOnAreaOverlayer.Connect Reprojector:Reprojected to the Point input port and Tester:Passed to the Area input port:
The previous PointOnAreaOverlayer was an overlap with only one result: a property either belongs to the city or it doesn't.However, the second PointOnAreaOverlayer can have multiple results, because there might be multiple artworks on a single site.
For that reason, open the parameters dialog for the second PointOnAreaOverlayer.Under Attribute Accumulation check the boxed labelled "Generate List" and enter a list name such as "ArtList":
This will cause the artworks for a particular property to be saved as an FME list attribute called ArtList.
9.Add a second Tester transformer (or duplicate the first one) and connect it to the second PointOnAreaOverlayer's Area port.Again set it up to again test for _overlaps greater than or equal to 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, each of which contains public art and has a list of those artworks attached:
10.An FME "list" is a way to have multiple values for a single attribute.Unfortunately, this is not a structure that many formats support natively.Therefore we need to handle these values in some way.
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).
This is one way to handle a list.It "explodes" it from one feature with multiple values, to multiple features each with one value.
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.
Firstly set the group-by parameter to "Property".This will create a separate report for each property.
Secondly, under Page Contents, the default content is a bar chart.Change this to Header and in the Content Settings under Text click the drop-down arrow and choose the Address attribute.Set the Header Level parameter to 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.Finally select Writers > Add Writer from the menubar.Set the format to HTML and specify a file to write to.Click OK to add the Writer and connect its feature type to the Output port of the HTMLGenerator:
13.Re-run the workspace.Locate the HTML file that has been written and open it in a web browser.You will find it displays a list of properties, each with its own list of artworks:
©2019安全亚搏在线软件公司|法律