Q:

Creating Direction data in QGIS between two layers?

Can I do it in Qgis, that there are two layers, a target layer and an input layer, and I ascertain with an algorithm so that the closest points on the input layer are on the target layer in what direction they are? 
Measured in degrees, with designation east, west, north, south, north east, south east, northwest, southwest? 
Creating a table that contains this data? 

A:

Not that long ago, I did something similar using two point layers: one containing the source; the other containing destinations.
Example layers:

What I did was:

Use the Distance to nearest hub algorithm with the following parameters to create a line layer showing the nearest destination point to the source point:

You can find the tool from:
Processing Toolbox > QGIS geoalgorithms > Vector analysis tools > Distance to nearest hub

Create a real field (e.g. "Direction") on the resulting line layer using the Field Calculator to calculate the direction of the lines using the expression below (as described in this post):
(atan((xat(-1)-xat(0))/(yat(-1)-yat(0)))) * 180/3.14159
+ (180 *(((yat(-1)-yat(0)) < 0) + (((xat(-1)-xat(0)) < 0 
AND (yat(-1) - yat(0)) >0)*2)))

Create a string field (e.g. "Principal") in the same line layer to calculate the principal direction of the line (i.e. north, north-east etc) using the expression below:
CASE
WHEN "Direction" >= 348.75 OR "Direction" < 33.75 THEN 'N'
WHEN "Direction" >= 33.75 AND "Direction" < 78.75 THEN 'NE'
WHEN "Direction" >= 78.75 AND "Direction" < 123.75 THEN 'E'
WHEN "Direction" >= 123.75 AND "Direction" < 168.75 THEN 'SE'
WHEN "Direction" >= 168.75 AND "Direction" < 213.75 THEN 'S'
WHEN "Direction" >= 213.75 AND "Direction" < 258.75 THEN 'SW'
WHEN "Direction" >= 258.75 AND "Direction" < 303.75 THEN 'W'
WHEN "Direction" >= 303.75 AND "Direction" < 348.75 THEN 'NW'
END

You should (hopefully) have the degree values and their respective principal directions in the Attribute Table. You could then, if you wanted, add some style and labelling to the line layer to showcase the attributes. 
I used an arrow style:

And labelled it:

To get this result:

A:

Probably refFunctions plugin is useful. It will give you additional functionalities in the Field Calculator.
When installation of refFunctions is done, open the attribute table of your input_layer.  Create 3 new fields in the following order:
Field [pt]   ......Text(String) length=40
geomnearest('target_layer', '$geometry')

Field [az]   ......Decimal number (real) length=12.8
degrees(azimuth($geometry,  geom_from_wkt("pt")))

Field [dir] ......Text(String) length=10
CASE 
WHEN  0 <= "az" AND "az" <= 45 THEN 'N'
WHEN 45 <  "az" AND "az" <= 135 THEN 'E'
WHEN 135 < "az" AND "az" <= 225 THEN 'S'
ELSE 'W'
END

Then you will get something like below:

Sorry I was lazy and skipped NE, SE, SW, NW but you will get an idea.

