[Qgis-user] hub lines

Richard McDonnell richard.mcdonnell at opw.ie
Thu Mar 27 06:46:48 PDT 2025


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.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
From: Michael.Dodd <michael.dodd at open.ac.uk>
Sent: 27 March 2025 11:01
To: Richard McDonnell <richard.mcdonnell at 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.mcdonnell at opw.ie<mailto:richard.mcdonnell at opw.ie>>
Sent: Thursday, March 27, 2025 7:49 AM
To: Richard McDonnell <richard.mcdonnell at opw.ie<mailto:richard.mcdonnell at opw.ie>>; Michael.Dodd <michael.dodd at open.ac.uk<mailto:michael.dodd at 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.mcdonnell@opw.ie

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

From: QGIS-User <qgis-user-bounces at lists.osgeo.org<mailto:qgis-user-bounces at lists.osgeo.org>> On Behalf Of Richard McDonnell via QGIS-User
Sent: 27 March 2025 07:37
To: Michael.Dodd <michael.dodd at open.ac.uk<mailto:michael.dodd at open.ac.uk>>
Cc: qgis-user at lists.osgeo.org<mailto:qgis-user at 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.mcdonnell@opw.ie

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

From: QGIS-User <qgis-user-bounces at lists.osgeo.org<mailto:qgis-user-bounces at lists.osgeo.org>> On Behalf Of Michael.Dodd via QGIS-User
Sent: 26 March 2025 17:54
To: 'qgis-user at lists.osgeo.org' <qgis-user at lists.osgeo.org<mailto:qgis-user at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250327/0cea2334/attachment.htm>


More information about the QGIS-User mailing list