I have a point shapefile with 80K+ records. Shapefile is projected in wgs84. The shapefile contains fields with the latitude and longitude of the point. I need a new field that contains a distance from a known point (Point B) in each record. Point B is the same for every record in the shapefile. There is a distance function in the field calculator (field calculator -> geometry -> distance). But I can't make sense of the syntax.
Example:
distance( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(4 8)' ) ) → 4
What I want to do is measure the distance from the geometry of the current point to the geometry of a point I supply (for example point at "25.906543, -80.546800"). How do I refer to the current record using that tool and how to a create the new geometry? Is is something like:
distance( geom_from_wkt( 'POINT(25.906543, -80.546800)' ),
($geometry ) )
distance matrix
? If so, how does it not suit your needs? Also, distance calculations using the field calculator in QGIS are done in the CRS of the layer, so based on a WGS84 layer you'd get distance in degree.