斯潘8
span4
Invalid geometry types are where the type of geometry is invalid for the class of feature that it represents;例如,自行车路径由点几何图形表示,or a river is represented by a polygon geometry (like below):
这种几何图形是否真正无效取决于用户对数据的解释和任何特殊情况。For example,the scale of the data might be such that both sides of the river bank are captured (as above),therefore a polygon is a perfectly legitimate geometry type.
无效的几何类型还包括组织可能具有的任何特殊规则,to permit situations that would usually be invalid.For example,a mapping organization may decree that a street lighting column is not stored by a point feature at its core location,但是,存储为表示可接受照明水平范围的多边形(如下所示):
一般来说,FME可以使用GeometryFiltertransformer and - in some cases - can fix problems using a几何坐标系.
NB:here an invalid geometry type means invalid for the rules of the organization.It does not mean the geometry is invalid for the format itself.
Locate Invalid Geometry: Workspace as a Template
Count Invalid Geometry: Workspace as a Template
本例的源数据集是(假定的)一组线条(在GML数据集中)表示轮廓。
The dataset looks like this in the FME Data Inspector:
The scenario here is that we have many contour files and wish to set up checks for bad geometry types using this single file as a prototype.如你所见,contours that form a closed shape were created as polygon features.此外,不仅有轮廓,但也要注意高度点和谁知道其他类型的几何图形。These features need either filtering or fixing using FME.
Follow these steps to learn how to identify contour features that have an invalid geometry type.
1。启动FME工作台,从一个空画布开始。
Select Readers > Add Reader from the menubar.在打开的对话框中,将数据格式设置为GML(地理标记语言)。Select the attached GML file as the source dataset.
单击“确定”关闭对话框并添加读卡器。
2。Add a GeometryFilter transformer after the GML reader feature type:
三。打开“几何过滤器参数”对话框。Here we can define which geometry types to filter.我们应该选择“线”,因为轮廓是由自然的线特征决定的。We should also select "Area" because we know area features exist and that they can be fixed.
再次单击“确定”和“确定”关闭对话框。工作区现在如下所示:
任何非线条或区域的几何图形都将“未过滤”。
4。将Inspector Transformers连接到每个输出端口并运行工作区。The non-line features will be filtered onto separate layers,显示如何单独处理它们。
计算坏特性的数量非常容易,因为我们已经将它们过滤掉了。For example,even the Workbench feature counts show us there are 40 unfiltered features.
要创建存储在属性中的计数,使用statisticscaleculator转换器很简单。
5.Add a StatisticsCalculator between the GeometryFilter:Unfiltered port and its Inspector transformer.打开参数对话框。
第一选择高程as the Attribute to Analyze.事实上,我们选择哪个属性并不重要,since we only want a count of features.
删除“计算属性”字段中的所有值,然后在“总计数”字段下添加“BadFeatures”。That will provide a count of the bad features.单击“确定”关闭对话框。
Re-run the workspace.这次,输出应该包含一个属性,该属性指示有多少坏特性。
NB:如果您将StatisticsCalculator:Summary输出端口连接到检查器,there will only be a single output feature.To get all output features ensure that the Complete port is connected.
Geometry types can be changed in FME using the GeometryCoercer.我们过滤掉了点特征(以及任何其他几何图形类型),因为没有简单的方法可以将它们转换为线特征。然而,area features can very easily be changed from a polygon to a closed line.
6。添加一个连接到几何过滤器的几何线圈变压器:区域输出端口:
Make sure it is connected as shown - with the coerced features joining the contours in a single Inspector transformer.
7。打开GeometryCoercer的“参数”对话框。Set the Geometry Type to output to "fme_line".
单击“确定”关闭对话框并重新运行工作区。The result is a clean set of contours with no invalid geometry types:
Here are some other techniques for fixing invalid geometry types.
1:When the geometry is supposed to be an island (or donut) but the 'hole' is filled in (like below):
…那么Donutbuilder变压器将是最好的解决方案。
2: When the geometry is supposed to be lines,但是是一个区域(如一步一步的例子),结果应该是一个网络(如这些道路特征)。
...then the GeometryCoercer changes the area to a line,但它不会在节点点拆分它。这就需要增加一个交叉变压器。
三。几何控制器可以将一条闭合的直线变成一个多边形特征,但它不会从一组单独的线条中构建多边形。这需要区域生成器变压器。
这里使用的数据来源于温哥华市提供的开放数据,不列颠哥伦比亚(数据.couver.ca)It contains information licensed under the Open Government License - Vancouver.
© 2019 亚搏在线Safe Software Inc |合法的