span8
span4
span8
span4
Previous: Polygon Within a Distance of Selected Features| Next:Generating Slope and Aspect
In this tutorial, you will learn how to find the nearest features using point and polygon datasets. The purpose of this operation is to find the nearest feature from an object of interest based on the straight line distance between features (i.e. starting from a point of interest, such as a school in Vancouver, find the nearest park polygon feature). In order to accomplish this, you need to use the NeighborFinder transformer. The NeighborFinder is typically used to identify nearest features, features within a specified distance, or finding the closest feature in a certain direction.
In this scenario, you are interested in determining where the nearest park with washroom facilities is from the starting point, Alexander Academy. In this exercise, you will learn how to query your datasets based on attribute values and perform a simple spatial analysis using a point and polygon dataset. For an in-depth tutorial on finding nearest neighbors and calculating both the distance and bearing for multiple features, see theDetermining Nearest Neighborsarticle.
The Tester will be used to “select” a school from the dataset.
This will reveal two buttons, an ellipsis button and a drop-down list.
To find out more about duplicated transformers, see theDesktop Basic Course Manual.
Note: FME allows you to duplicate transformers that are currently on the canvas by right-clicking the transformer and selecting duplicate from the menu. Alternatively, you can select the transformer and use the shortcut CTRL+D to duplicate the selected transformer(s). So far, your workspace should look like the screenshot provided below:
第二个测试仪将用于查询Parks DataSet,因此只能返回具有指定属性的功能。您将设置两个将使用PASS标准的测试条件“所有测试(和)” - 所有测试必须通过传递的输入功能。有关测试人员和通过标准的更多信息,请参阅测试人员Documentation.
Left Value | Operator | Right Value |
Washrooms | = | Y |
DogPark | = | N |
Ensure your Tester Parameters dialog matches the screenshot below then click OK to accept the changes and close the dialog.
在这种情况下,the default parameters for the NeighborFinder work because it will find only find 1 neighbor.
Note: To correctly analyze spatial relationships, all features should be in the same coordinate system. TheReprojectormay be useful for reprojecting features within the workspace. However, in this case, both features are already in the same coordinate system.
通过按数值按升序排序,最近的功能将放在属性表中列表的顶部。
Since you are interested in finding the nearest feature you will sort based on the _distance attribute in Numerical Ascending order.
Attribute | Alpha/Num | Order |
_距离 | Numeric | Ascending |
在这种情况下,采样器变压器用于在属性表中选择第一个记录(即,自最近的功能,因为我们只是通过_distance属性上的升序排序)。
运行工作空间后,最近的公园的输出将显示在FME数据检测器中,并在亚历山大Academy的地图上有一个点参考。If you wish to save the output, you can either connect a writer to the Sampler:Sampled port or by using the Save Selected Data as in the FME Data Inspector and selecting the format that you want to save the data as (i.e. PostGIS, File Geodatabase, DWG, etc.). For more information on saving data in the FME Data Inspector, see theDocumentation.
Data used in this tutorial originates from open data made available by theCity of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.
© 2019 Safe Software Inc |Legal