Hi Michael,

You could try length($geometry) units are generally meters but are usually 
defined by the CRS.
Here’s another tutorial on Lengths and statistics anong with one on Basic 
Networking, using POI and Line Network, hopefully it will help along with the 
revised length formula.

Basic Length and 
Statistics<https://www.qgistutorials.com/en/docs/calculating_line_lengths.html>
Basic 
Network<https://www.qgistutorials.com/en/docs/3/basic_network_analysis.html>

My experience in using Network Analysis is very limited, so I don’t believe I 
can be of any further help.
Kind Regards,

Richard


——
Richard McDonnell MSc GIS, FME Certified Professional
Flood Risk Management - Data Management

——
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
——
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

——
To send me files larger than 30MB, please use the link below 
https://filetransfer.opw.ie/filedrop/richard.mcdonn...@opw.ie

Email Disclaimer: 
https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
From: Michael.Dodd <michael.d...@open.ac.uk>
Sent: 27 March 2025 11:01
To: Richard McDonnell <richard.mcdonn...@opw.ie>
Subject: RE: hub lines

Perhaps a bit more complicated than I suggested.

 1.  It is a global map in lat long coordinates so the length values come out 
as rather strange with $length (negative or positive very large numbers without 
saying what units)
 2.  The data I am using to create the hub and spoke are in two files. One has 
a series of points each with its own identifier and an identifier for the hub 
to connect to. The second has a series of hub points with their coordinates, 
these are the ones that connect to the points in the first file. Items in both 
files are in random order, each hub connects to some short distances and some 
very long distances it is not a matter of which hub is closest to each point, 
there are often hubs that are much closer to points but they are not connected 
and this is fine.
 3.  It is a shame that the hub and spoke analysis does not have the option to 
produce the line lengths as an extra column automatically as I suspect most 
people using this function would need them. It does have options for global 
maps such as the ones I am using, I have not tried using them yet as the 
datasets are very large and even without those more complex calculations it 
took 8h of computing time to get the result and am worried it will take several 
times that long. Although it takes so long qgis only uses a relatively small 
amount of the computer’s resources.



From: Richard McDonnell 
<richard.mcdonn...@opw.ie<mailto:richard.mcdonn...@opw.ie>>
Sent: Thursday, March 27, 2025 7:49 AM
To: Richard McDonnell 
<richard.mcdonn...@opw.ie<mailto:richard.mcdonn...@opw.ie>>; Michael.Dodd 
<michael.d...@open.ac.uk<mailto:michael.d...@open.ac.uk>>
Subject: RE: hub lines


External email: if the sender or content looks suspicious, please click the 
Report Message icon, or forward it to report-phishing
Michael,
Forgot to add, you can use the Field Calculator to create a new column called 
length and using “$length”, without quotes, to calculate the length of each 
line segment
From there you can also create further fields, like Average, Max, Min etc., 
using the Basic Statistics for fields tool (Vector, Analysis Tools, Basic 
Statistics for fields)
Kind Regards,

Richard


——
Richard McDonnell MSc GIS, FME Certified Professional
Flood Risk Management - Data Management

——
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
——
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

——
To send me files larger than 30MB, please use the link below 
https://filetransfer.opw.ie/filedrop/richard.mcdonn...@opw.ie

Email Disclaimer: 
https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/

From: QGIS-User 
<qgis-user-boun...@lists.osgeo.org<mailto:qgis-user-boun...@lists.osgeo.org>> 
On Behalf Of Richard McDonnell via QGIS-User
Sent: 27 March 2025 07:37
To: Michael.Dodd <michael.d...@open.ac.uk<mailto:michael.d...@open.ac.uk>>
Cc: qgis-user@lists.osgeo.org<mailto:qgis-user@lists.osgeo.org>
Subject: Re: [Qgis-user] hub lines

Hi Michael,
I believe what hat you are looking for is Network analysis. You can have a look 
HERE<https://docs.qgis.org/3.40/en/docs/training_manual/vector_analysis/network_analysis.html>
 which should help. Shortest Path is what you would be looking at.
Kind Regards,

Richard



——
Richard McDonnell MSc GIS, FME Certified Professional
Flood Risk Management - Data Management

——
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
——
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

——
To send me files larger than 30MB, please use the link below 
https://filetransfer.opw.ie/filedrop/richard.mcdonn...@opw.ie

Email Disclaimer: 
https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/

From: QGIS-User 
<qgis-user-boun...@lists.osgeo.org<mailto:qgis-user-boun...@lists.osgeo.org>> 
On Behalf Of Michael.Dodd via QGIS-User
Sent: 26 March 2025 17:54
To: 'qgis-user@lists.osgeo.org' 
<qgis-user@lists.osgeo.org<mailto:qgis-user@lists.osgeo.org>>
Subject: [Qgis-user] hub lines

I have produced a map with hub lines using the vector analysis tool but now 
want to analyse the lines themselves e.g. work out max/min/total distances from 
a node and not sure how to do this as the attribute table from the hub layer 
does not have the line related data. Presumably I have to add it to the table 
but not sure how to do that in this instance.
_______________________________________________
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to