Assuming that you have one point layer for the poles and
one for the houses, you should be able to get this done
using the NNJoin plugin (If your QGIS version is
recent you can also use the Join attributes by nearest
algorithm).
1) Use NNJoinJoin, with your line layer as Input vector
layer, the pole layer as Join vector layer and pole_
as Join prefix.
The result is a line layer where for each line, the
fields of the nearest pole in the pole layer have been
added (the names of these fields will all have pole_
as a
prefix), together with the distance from the line to that
pole.
If you would like to use the distance
field from this
join, you will have to rename it, so that it is not
overwritten in the second step.
2) Use NNJoinJoin, with the output (line)
layer from your first join as Input vector layer, the house
layer as Join vector layer and house_
as Join prefix.
The result is a new line layer where for each line, the
field of the nearest house in the house layer has been
added (the names of these fields will all have house_
as a
prefix), together with the distance from the line to that
house.
3) Open the attribute table of the resulting line layer
and, using the field calculator, set the value of the
Start point field to the value in the pole_name
field.
Set the value of the End point field to the value in
the house_name
field in the same way.
4) (optional) Remove the fields that were added from the
pole and house layers from the new line layer.
If there are houses closer to the line than the destination
house, they will be chosen, because the whole line is
considered when searching for the nearest nearest neighbour.
To avoid this, you will first have to
extract the start and end points of the line and use the
resulting point layers for the joining, and afterward join
the attribute tables from the results of these joins back
into the line layer (remember to include IDs for the lines
in the start and end point layers, so that you can join
them back after the nearest neighbour join).