第8页
span4
Self-intersections (also known as "loops",“蝴蝶结”或“鱼尾”)是指其边界扭曲,使其与自身相交的特征。causing a loop:
The left-hand example shows where the end point of a polygon did not meet the start point,causing the polygon to close itself with a loop.
The right-hand feature is an example of points that are perhaps out of sequence.It comes very close to being a line that directly reverses back on itself and very close to being a spike,but the layout actually causes a loop to form.
In most cases,自我交叉并不像这些那样明显。左边的例子通常要小得多-到看不见的程度-右边的例子通常有非常锐利的角度,看起来像一条线。
FME包括使用几何验证程序transformer.
在这个例子中,我们将研究在包含建筑轮廓的数据集中识别和修复自交集。
Self Intersections: Workspace as a Template
The source data is an OpenStreetMap dataset containing buildings in the city of Vancouver:
地图平铺方式 Stamen Design,在下面 CC-BY-3.0型.Data by OpenStreetMap,在下面 CC-BY-SA.
有很多建筑,所以(为了简单起见)我们会说一个用户报告了两个包含问题的建筑。他们的身份证号码是102521333和301873712,我们需要调查。
Follow these steps to learn how to locate self-intersecting features with a GeometryValidator transformer.
1.启动FME工作台,从一个空画布开始。Select Readers > Add Reader from the menubar.
Set the data format to OpenStreetMap (OSM) XML and select the attached OSM dataset as the source.Set the 亚搏在线Workflow Options to Single Merged Feature Type (to make sure all building objects are read as a single layer) and click OK to add the reader.
2.Place a Tester transformer on the canvas.设置测试仪以测试ID=102521333或ID=301873712的位置:
NB:我们只需将所有建筑传递到几何验证器中,忽略传递的特性,但在本练习中,当可疑的特性已经被隔离时,运行起来更快,更容易发现错误。
三。Place a GeometryValidator transformer connected to the Tester:Passed port.打开参数并在二维问题中对自交集进行复选标记。在对话框底部,将“尝试修复”设置为“否”。
Connect Inspector transformers to the GeometryValidator output ports and run the workspace.failed和issuelocations输出如下所示:
地图平铺方式 Stamen Design,在下面 CC-BY-3.0型.Data by OpenStreetMap,在下面 CC-BY-SA.
The left-hand building - if it's a single polygon - has obvious problems,with the outer perimeter crossing at several locations.In fact,查询该特征以证明它是具有单个周长的单个多边形。
The right-hand building has less obvious problems.您需要非常靠近建筑物右上角(东北角)放大,以查看问题:
Incidentally,that little offset is 0.7mm (about 0.03") so you can see how a tiny mistake like that can cause a problem geometry.
所以,现在我们有了所有包含自交集的特性,带有一个点特征,表示自相交的位置。
Counting self-intersections is very simple with a StatisticsCalculator transformer.The only decision is whether to count the number of problem features,or the number of self-intersections,这不一定是同一件事。
4.Place a StatisticsCalculator transformer.To count invalid features connect it to the GeometryValidator:Failed output port.要计算自交叉点,请将其连接到geometryvalidator:issuelocations输出端口。
5.Inspect the parameters for the StatisticsCalculator transformer.Select any attribute in the Attribute to Analyze parameter (it doesn't matter which one).
Now set the Total Count Attribute to a new attribute name such as NumberBadFeatures or NumberSelfIntersections,以适当者为准。
6.将Inspector Transformer连接到统计计算器输出端口(如果选择摘要端口,将获得单个功能,if you select the Complete port you get all the original features).Run the workspace.现在您应该有一个坏特性的数量(2)或自相交的数量(4)。
There are a number of ways in which a self-intersection could be fixed.For example,a gap could be opened at the point of intersection so that the two pieces of linework don't cross:
另一种解决方案是将特征实际划分为两个(或更多)多边形,splitting them at the intersection point.In fact,这是FME采用的技术。
第七章。Check the GeometryValidator transformer's parameters and set the Attempt Repair parameter to Yes.
8.[可选]要解决几何验证程序的故障(现在它将删除失败功能的坐标系),请在几何验证程序:失败端口和连接的检测程序变压器之间放置一个坐标系统设置器变压器。检查参数,将坐标系参数设置为LL84。
9.重新运行工作区并检查输出,concentrating on the Repaired output.请注意,FME已将原始的单个多边形特征拆分为多部分特征,consisting of several polygons/outlines:
We now have a set of data that has been cleaned of self-intersection.If automatic cleaning is not desirable then the intersection points can be used to identify places to check where problems might be manually resolved.
OpenStreetMap Datasets: © OpenStreetMap contributors.参见http://www.openstreetmap.org/版权所有
© 2019 亚搏在线Safe Software Inc |Legal