[Qgis-user] create a route with several points at once
chris hermansen
clhermansen at gmail.com
Fri Mar 28 06:18:45 PDT 2025
Humberto, everyone
On Thu, Mar 27, 2025 at 12:59 PM Humberto Vargas Espinoza <
hvargas at correos.go.cr> wrote:
> 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.
>
>
First, I noticed your two datasets are in different coordinate reference
systems (CRS). In my experience, many analysis routines in QGIS require
all inputs to be in the same CRS. Also, depending on the type of analysis,
it may be wise to make sure the CRS chosen is projected, rather than
geographic; at least when distance calculations are involved, because
distances in decimal degrees are often not what's required.
So, I converted both of your datasets to WGS84 UTM zone 16n (arbitrary
choice on my part but it seems basically reasonable for Costa Rica), saving
them as GeoPackages (arbitrary).
Then I opened the menu option Processing and typed "travel" into the search
bar in the processing toolbox on the right. An option to do the work in
GRASS came up - "v.net.salesman".
I clicked on that, and selected the following options:
Input vector line layers (arcs): carreteras wgs84 16n [EPSG_32616]
Centers point layer (nodes): ruta 01 wgs84 16n [EPSG:32616]
I left the remainder of the parameters as-is and clicked [Run].
I did not time the execution but I would say it was on the order of 30
seconds on my i7 laptop.
One point, IDSIG 101050447A, was too far from a network segment to be
included. Otherwise the network looks fine.
So, with the caveat that you must select a common projected CRS and adjust
the location of the distant point (or otherwise connect it to the network),
I think you should find this works for you.
--
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/20250328/4185897d/attachment.htm>
More information about the QGIS-User
mailing list