iwfm.nearest_node

iwfm.nearest_node(point, node_set)[source]

Find the nearest node to a point from the node array.

Parameters:
  • point (tuple) – (x,y) point

  • node_set (list) – list of [node_id, x, y] entries

Returns:

nearest – node id of the nearest node, or -1 if node_set is empty

Return type:

int