I am new to QGIS.
I have two layers (
layer_b) consisting of two sets of points.
If I want to find the nearest point in
layer_b for each point in
layer_a, I can just use the Distance matrix calculator that comes with the graphical interface in QGIS.
My issue is slightly more complicated. I want to group both layers by an attribute value, before I calculate the distance between points.
layer_a has a bunch of points to libraries around the world and
layer_b has a bunch of points to big cities around the world, and both layers have an attribute where the value tells me which country each point is in, then I want to find the shortest distance between a library point in a specific country and a big city point in the same country.
I could accomplish this by splitting the layers by country and then repeating the analysis on each layer (i.e. distance between library points in Germany and big city points in Germany), using the graphical interface in QGIS, but this is tedious. Also, in reality I will have thousands of groups.
How do I do this in QGIS?