kartoza / stream_feature_extractor

A QGIS plugin to extract stream features (wells, sinks, confluences etc.) from a stream network
GNU General Public License v2.0
6 stars 9 forks source link

We need to be able to identify points within a snapping distance of each other #9

Closed timlinux closed 10 years ago

timlinux commented 10 years ago

Problem

Given a point layer, identify all points within distance K from input point and return array of ID's.

Proposed solution

The algorithms:

nearby_points = []
for neighbor_point in points:
    if current_point != neighbor_point:
        if distance(current_point, neighbor_point) < K:
            nearby_points.append(neighbor_point.ID)

Expected outcome

A list of nearby nodes ID from a node.