span8
span4
无效的关系是在某种程度上在不合逻辑的功能之间存在空间关联的地方;例如,自行车路径通过湖泊或街道照明柱出现在建筑占地面积内(如下):
这种关系是否真正无效取决于用户对数据的解释和任何特殊情况。例如,自行车路径可能会在木制走道上穿过湖泊,或者街道照明柱可能真正在建筑物的屋顶上或悬垂下方(以上述至少一个似乎)。
因此,FME可以突出可能的问题,但只有最终用户可以决定出了什么问题,并且是正确的,以及如何修复。
Invalid relationships also cover any special rules that an organization may have, to cover situations that are not by nature invalid. For example, a mapping organization may decree that a bicycle path is incorrect if it passes through an area of land not owned by the city. Or street lighting columns might be invalid if they are more than 50 metres apart, representing the distance at which lighting would become unacceptably dim (like below):
因为有各种关系可以测试,FME中有各种变压器可用于测试它们。以下示例和注释涵盖其中的一些。
NB:如果需要,本示例中使用的栅格瓦片可以作为其中的一部分下载Safe sample dataset
此示例的源数据集是代表温哥华市中的周期路由的一组线(在三个ESRI Shapefiles),以及代表温哥华市范围的单个多边形(再次在ESRI Shapefile格式中)。
The dataset looks like this in the FME Data Inspector:
这里的情景是我们希望检查是否有任何循环路线错误地落在城市边界之外;例如,它通过港口或小溪,或者它部分落在边界并进入不同的市政。
按照以下步骤了解如何识别与城市边界有无效关系的周期路径功能。
1. Start FME Workbench and begin with an empty canvas.
选择读者>从Menubar添加读者。在打开的对话框中将数据格式设置为ESRI shapefile。由于两个源数据集都是Shapefile格式,因此我们可以使用相同的读者读取它们两个。
If the attached datasets are stored in the same folder, click the browse button and select all four of them. then click OK to close the dialog and add the reader.
但是,如果数据集存储在单独的文件夹中,请单击“高级浏览器”按钮:
In the Advanced Dialog click the Add Files button and add each Shapefile in turn.
Click OK to close the dialogs and add the reader.
2.自行车路径是长特征,简单地确定哪条线重叠到城市边界并不特别有用;相反,必须剪切输出每行的实际无效部分。
So, add a Clipper transformer to the workspace. Connect the VancouverLandBoundary dataset to the Clipper port and the bicycle path feature types to the Clippee port:
3. Attach an Inspector transformer to the Clipper:Outside port, and also to the VancouverLandBoundary feature type; then run the workspace.
很明显,有几个地方的自行车路径延伸到温哥华土地边界之外,但它不太清楚哪个数据集是正确的,除非我们可以看到背景映射。
So in the FME Data Inspector select Tools > FME Options and select a background map to display. Alternatively select File > Add Dataset, set the format to GeoTIFF (Geo-referenced Tagged Image File Format) and select the GeoTIFF files mentioned in the Downloads section.
现在我们可以看出周期路径或陆地边界数据是否正确(在上面的屏幕截图中,循环路径明显正确)。检查所有剪裁的自行车路径部分,以查看是否需要修复。
Counting the number of bad features is quite easy because we have already filtered them out. For example, even the Workbench feature counts show us there are 28 bad pieces. But it would be useful to know how many cycle paths have a problem and how many bad pieces there are per cycle path.
要创建存储在属性中的计数使用统计信息算子变压器简单。
4.在CLIPPER之间添加两个统计信息仪器:外部端口及其检查器变压器。确保将摘要输出端口连接到第一个统计信息管理器中,但第二个输出端口。
打开第一个统计信息管理器的参数对话框。这将用于告诉我们每个路径中有多少件糟糕的碎片。因此,通过参数将组设置为pathid。
下一个选择pathid作为分析的属性。实际上,我们选择的属性并不重要,因为我们只想要一个功能。
Delete all the values from the Calculate Attributes field and then add "BadSections" under the Total Count field. That will provide a count of the bad sections for each path.
单击“确定”关闭对话框。
5.打开第二个统计信息管理器的参数对话框。选择BadSections作为分析的属性(再次并不重要我们使用)。删除计算属性字段,然后在总计字段下添加“Badpaths”。
重新运行工作区。这次输出应包括一个属性,表示有多少糟糕路径,以及每个路径有多少坏部分:
These are just statistics, not geometry. To save the geometry for the bad sections, add a writer connected to the Clipper:Outside output port.
Fixing invalid features like this is generally not possible using FME, because of the need for user validation of the bad features. In fact, if you examine the output from this example you'll see that in all cases the "bad" sections of cycle paths are caused by either a) passing over a bridge, or b) incorrect land boundary geometry.
1: Instead of adding the GeoTIFF data to the Data Inspector we could turn on a background map, or even add the GeoTIFF as an automatic backdrop.
2: To find problem point features, like the street lighting columns located inside a building, follow the instructions forPoint-in-Polygon processing在下面Common GIS Operations tutorial
3: To find problem features like areas incorrectly overlapping, check the Slivers and Overlaps article in this tutorial, or the提取多边形交叉点article in the Common GIS Operations tutorial
这里使用的数据来自不列颠哥伦比亚省温哥华市提供的开放数据(data.vancouver.ca.)。它包含根据开放政府许可证的信息 - 温哥华。
© 2019 Safe Software Inc |Legal