Fixed iterating node group_id in iterate.py

Now the script gets group_id from routes table.