In a QGIS3-project (QGIS Version 3.4.3) I'd like to display points from a textfile and constructed lines from this points in an given length and an angle from the textfile with the geometrygenerator. The CRS of the map is ETRS89 32N (EPSG:25832) and the coordinates from the textfile are WGS84 (EPSG:4326). "On-the-fly-transformation" is turned on. In the textfile there are the values "x", "y", "xangle".
To display the lines in the given direction, I used this code in the geometrygenerator:
make_line($geometry, make_point( $x + 0.002*cos(radians(90 - "xangle")), $y + 0.002*sin(radians(90 - "xangle")) ))
The problem is, that the resulting line differs in the angle from the same construction with points which are original in EPSG:25832 and therefore are in the same projection like the map. Here one screenshot (blue line = map crs 25832; red line = crs 4326) with 90°, which looks not to problematic:
The other thing is, that ETRS is metric, so I can define the length of the line in Meters and not (like above) in Degrees. I tested to work in the geometrygenerator with "make_point" direct from the columns of the textfile and "transform". But then there was no line generated.
Maybe someone has got a hint for me to solve this problem. First export the txt to shape with transformation to ETRS is not an option, because the idea is to read from the file in realtime, when something is changed.