span8
span4
A common GIS operation is to merge (or dissolve) polygons together;for example two (or more) polygons have their shared boundary removed to become a single polygon.
For example,I might have a dataset of polygons representing the provinces of Canada.I want to dissolve them together in order to get a single polygon representing Canada as a whole.
在FME中执行此操作的变压器称为溶解器。Often polygons need to be dissolved according to some attribute value and the "Group-By" parameter in the Dissolver allows this to happen.
Note that polygons do not have to have exact boundaries to be dissolved.同样可以溶解边界重叠的多边形;either those whose boundaries naturally overlap,或者那些边界本应重合但定义不清的人。
The source datasets for these examples are an Excel spreadsheet of election results and a polygon dataset in GML format representing election boundaries.
This example will merge the election results onto the election boundaries so that neighboring boundaries won by the same candidate/party can be dissolved together.
1。Start FME Workbench and begin with an empty canvas.Select Readers > Add Reader from the menubar.
Set the data format to GML (Geography Markup Language).Select the attached GML file as the source dataset.When prompted select only the VotingDivisions feature type (layer) to add to the workspace.
2.Once more select Readers > Add Reader from the menubar.This time set the format to Microsoft Excel and select the attached Excel file as the source.When prompted,select only the PartyResults sheet to add to the workspace.
三。将FeatureMerge Transformer添加到工作区。将VotingDivisions功能类型连接到请求程序端口,将PartyResults功能类型连接到供应商端口:
Open the parameters dialog and select the Division attribute under the Requestor and Supplier Join attributes:
这将把partyresults表(supplier)中的所有属性合并到votingDivision多边形(requestor)中,其中division属性是匹配的。
4.我们希望以一种方式检查溶解器的输出,即每一方的胜利都有不同的颜色,so add a FeatureColorSetter transformer connected to the FeatureMerger:Merged port.
Open the parameters dialog.将配色方案设置为Random,并根据参数将Randomize设置为“attributes”。Select the Winner attribute (which was copied from the PartyResults table) as the attribute to randomize by:
This will color each polygon the same where it was won by the same party.
5.Attach an Inspector transformer and run the workspace.You should find each polygon is colored according to the winner,but adjacent polygons of the same color are not (yet) merged:
6。Now add a Dissolver transformer into the workspace,before the FeatureColorSetter:
Open the parameters dialog.Under the Group-By parameter select the Winner attribute.这将确保仅在“赢家”属性的值匹配的情况下合并多边形。
Under the Attributes to Sum parameter select the attributes Party1,第2部分,Party3.These attributes represent the number of votes per area,per party.By selecting them here the votes of each dissolved polygon will be added together.
Re-run the workspace.The result will now look like this:
Notice that adjoining areas - where they were won by the same party - have been dissolved together.还要注意的是,每个解散区域中每一方的投票数已经加在一起,为单个解散多边形提供了一个新的值。
使用PointOnAreaOverlayer计算多边形中的点
Coordinate Systems and Measurements with the Reprojector
Distance Measurements with the LengthCalculator
Buffering features for Spatial Relationship Analysis
Shortest Route Calculations with the ShortestPathFinder
Creating Time and Distance Isolines using the NetworkCostCalculator
© 2019 亚搏在线Safe Software Inc |Legal