[Qgis-user] create a route with several points at once
Humberto Vargas Espinoza
hvargas at correos.go.cr
Thu Mar 27 08:58:45 PDT 2025
Good afternoon
I'm adding the point and road files. The points aren't created in any chronological order. Based on the points, I want an optimal route based on the road shape.
De: chris hermansen <clhermansen at gmail.com>
Enviado el: jueves, 27 de marzo de 2025 08:10
Para: Ujaval Gandhi <ujaval at spatialthoughts.com>
CC: Humberto Vargas Espinoza <hvargas at correos.go.cr>; qgis-user at lists.osgeo.org
Asunto: Re: [Qgis-user] create a route with several points at once
Ujaval, Humberto and everyone,
Re-reading Humberto's email, I have the sense that he may not have a suitable road network. If that's the case, he needs to acquire it before starting. I don't believe there's any point in trying to generate a "pseudo" road network from the points themselves.
Almost for sure, as Ujaval says, this is a travelling salesman problem and heuristic algorithms, in particular simulated annealing, are recognized as decently efficient ways to get an approximately good route.
It's worth reading the WIkipedia article on the travelling salesman problem<https://protect.checkpoint.com/v2/r02/___https:/en.wikipedia.org/wiki/Travelling_salesman_problem___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OmRmYWU6NDc2MzhjZmM5NTQyMzcxYWFiYzNhMTNiOTY1OGU1ZWNkY2NhMWMzMjlhODZlNzk3NWVhZjA0NjY1OTAyYTNiYzpoOlQ6Tg>.
On Thu, Mar 27, 2025 at 10:51 AM Ujaval Gandhi via QGIS-User <qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>> wrote:
If your points are sequential, then it is a simpler routing problem where you find the shortest path along a road network between successive points. You can do it with ORS Tools plugin using OSM data or QNEAT3 plugin if you have your own road network. See some tutorials at https://www.qgistutorials.com/en/#network-analysis<https://protect.checkpoint.com/v2/r02/___https:/mailtrack.io/l/668402be1f2b223210d5ef7122dfa9e023b70b7c?w=cWdpcy11c2VyQGxpc3RzLm9zZ2VvLm9yZw&url=https%3A%2F%2Fwww.qgistutorials.com%2Fen%2F*23network-analysis&u=8747767&signature=83a1062400bbbaab___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OjMxZjE6NTUyNDZlMTcxNTg0YjM1NGRkMWE2MjhiOWUyMTk2YjJjMTc5ZTZlYmY1MjNmMDRkYWI3MmE0YzAyM2QzMmRiYzpoOlQ6Tg>
If your points are not sequential and you want to find the optimal route between them, it is called the 'travelling salesman' problem and is a much harder problem. I am not aware of any easy QGIS approaches. Many of my students have used the OpenRouteService Optimization API<https://protect.checkpoint.com/v2/r02/___https:/nbviewer.org/github/amitkb3/python_spatial_analysis_final_project/blob/master/PythonSpatialAnalysisCourse_FinalProject.ipynb___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OmJlZTc6YzdiMzJlYzc5MGViMGYzODhmZWY2ODdjYzA1Yzg0MDBhNGEyMGY3M2QwNmY3ZTk2ZTYzYjg1NzM0Y2IyZWY2NTpoOlQ6Tg> to solve this using Python.
---
Ujaval Gandhi
Spatial Thoughts
www.spatialthoughts.com<https://protect.checkpoint.com/v2/r02/___https:/mailtrack.io/l/6b03a239a4dfe15aac1f976c1d652762f9df8a73?w=cWdpcy11c2VyQGxpc3RzLm9zZ2VvLm9yZw&url=http%3A%2F%2Fwww.spatialthoughts.com&u=8747767&signature=b1900ce0a08b40a7___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OjA0MmE6MjYxNTU0ODcwMzJmZjdkNTAzYTlkOThkOWNmMDAxMjU0MTliMDVjZTBhOTI5NWFhMTE1ZTQzYjc0NTdlNzlkYjpoOlQ6Tg>
On Thu, Mar 27, 2025 at 6:35 PM Humberto Vargas Espinoza via QGIS-User <qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>> wrote:
Good morning.
I have the following question.
I have a number of georeferenced points and I need to generate a route with a road shape and have the optimal route created with all the points at once. There are a lot of points, and extensions from point to layer or layer to point aren't optional for me.
[cid:image001.png at 01DB9EFF.0DACF750]
_______________________________________________
QGIS-User mailing list
QGIS-User at lists.osgeo.org<mailto:QGIS-User at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user<https://protect.checkpoint.com/v2/r02/___https:/lists.osgeo.org/mailman/listinfo/qgis-user___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OjY2ZjY6MTFiYjVjZWE2YzRjODI4ZGE2OTdiYzU1NTRiZjI1Y2UwNWIyMTI0NTdjMWUwZWFmMGI0OWNhYWJkNDVlZTg2ZjpoOlQ6Tg>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user<https://protect.checkpoint.com/v2/r02/___https:/lists.osgeo.org/mailman/listinfo/qgis-user___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OmM2NGU6Mzc0ZGIxMDUwYjliZjAzYWZmNzM2NGY4OWJjMDdjZmMzOWYzYzIzNWIwZjQ3OTE5YWIzOWRkYzYzMWNjNTNkNjpoOlQ6Tg>
_______________________________________________
QGIS-User mailing list
QGIS-User at lists.osgeo.org<mailto:QGIS-User at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user<https://protect.checkpoint.com/v2/r02/___https:/lists.osgeo.org/mailman/listinfo/qgis-user___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OjMxYzE6OTFiZmI3MzlkYjE5NTA0ZDAzMzdkODFiMmQ1NzIyNDc1M2JlZTQyYWViMDgwY2NhYjFiNThkMGE5NWIwNDNiNzpoOlQ6Tg>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user<https://protect.checkpoint.com/v2/r02/___https:/lists.osgeo.org/mailman/listinfo/qgis-user___.YzJlOmNvcnJlb3NkZWNvc3RhcmljYXNhOmM6bzo1OThlMTdhNGQzOWZhYWIyYTYwNzJlNzNmMzAxZmFiODo3OmEyNDY6OTc1NDhjNTNmN2UyZmU4YzlmOGVjMzdhNjBlMjczMmFlZDY1NzRmMzE3YWMwOWYwZjFkZDE0ZTdmMWIxMzhmZTpoOlQ6Tg>
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250327/acbf89e8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 214291 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250327/acbf89e8/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RUTA 01.zip
Type: application/x-zip-compressed
Size: 4878 bytes
Desc: RUTA 01.zip
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250327/acbf89e8/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: carreteras.zip
Type: application/x-zip-compressed
Size: 5043029 bytes
Desc: carreteras.zip
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250327/acbf89e8/attachment-0003.bin>
More information about the QGIS-User
mailing list