I'm more or less a beginner with QGIS, I've used version QGIS 3.10. I would like to calculate distances (in meters or kilometers) of a number of points to one certain reference point. Is it possible to do this with the QGIS field calculator? The points are geometry points with latitude and longitude in WGS84. The attribute table looks like:
Point_ID Latitude Longitude Distance_m
1 46.27789 9.87763
2 46.27366 9.87701
3 46.27565 9.88045
4 46.27600 9.87822
Point with ID #1 should be the reference point. The linear distance between point #1 to all the other points is my wished result.
I tried several versions like:
distance(geom_to_wkt($geometry ), geom_to_wkt(POINT('POINT_ID'='1')))
or
distance(geom_to_wkt($geometry ), geom_to_wkt(geometry(get_feature_by_id('Point_ID', '1'))))
while the first geometry includes all points listed in the attribute table and the second geometry is the reference point from which distances should be calculated.
but the result is always "NULL".
The distance matrix is not the aim as I get any distance of any point with it. The aim is a sub matrix of the distance matrix...