Geographic Information Systems Asked on July 12, 2021
I have a layer with about 500 single points. Now I want to measure the distance between each of these points and one specified observation point.
I need the distance to show how far away from the observation point every of these points was located to build a table for detection probability.
I already tried lots of Plugins (Hub Distance, NNJoin, …), but simply can’t find a proper way to calculate what I need.
Put your observation point in a point layer and use "Distance Matrix" from the Vector... Analysis Tools menu.
Make sure there's a unique ID column in your layer of points. I've got one point in the "source" layer and eleven in the "targets" layer. The table output has the ID of each target point and the distance to the source point. You could join this to the target layer if you need it there. Change the output matrix type to NxT. Here's the dialog and the resulting output:
Answered by Spacedman on July 12, 2021
Another option from mentioned by @Spacedman is the following:
This option could also help you to create some nice visualizations.
Plugins > Connect Points > Settings
and set appropriate options.$length
.Answered by Mykola Kozyr on July 12, 2021
OK, thanks so far. I think i figured out my problem. I have doubled IDs in my table so its impossible to connect each point with the source point.
Answered by Lena on July 12, 2021
In the "Field Calculator" of your point layer use the following expression:
length(shortest_line($geometry, geometry(get_feature('end', 'id', '7'))))
where get_feature('end', 'od', '7')
refers to a feature by its "id"
from a point layer called 'end'
, otherwise you can use geom_from_wkt()
.
Then your updated Attribute table will look like:
If new geometries have to be created, then try using the "Geometry by expression" geoalgorithm from the QGIS's Toolbox with the following expression:
shortest_line($geometry, geometry(get_feature('end', 'id', '7')))
and get the output
Answered by Taras on July 12, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP