Finding nearest neighbors
Finding nearest neighbors – for example, the airport nearest to a populated place – is a common task in geoprocessing.
To do this, load the popp.shp into QGIS as well as the airports.shp, if this is not already loaded. Then search for the Distance to Nearest Hub tool (Line to Hub) in the toolbox. You should use the popp.shp as the Source points layer and the airports as the Destination hubs layer. The Hub layer name attribute will be added to the results attribute table to identify the nearest feature. Select NAME to add the airport name to the populated places.
It is recommended that you use the Layer units as Measurement units to avoid potential issues with incorrect measurements, as seen in the following screenshot: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access