[Qgis-user] Least Cost Path
chris hermansen
clhermansen at gmail.com
Wed Feb 5 14:42:32 PST 2025
Krishna and list,
On Wed, Feb 5, 2025 at 9:10 AM krishna Ayyala <ayyalakrishna at gmail.com>
wrote:
> Chris,
> I am attaching the sample data. I have downloaded the road network online
> which is an ESRI data. For this data, I am unable to run either shortest
> path (layer to point) tool or v.net.salesman tool. It is giving me errors.
> What corrections do I need to make to the network inorder to make this run?
> Regards.
>
I looked at your data very briefly. Here is a zoomed in portion near one
of your points:
[image: image.png]
Looking at the line layer, it doesn't look to me to be a network graph,
that is:
1. in a graph, all lines join at nodes - that is not the case in your
data; I am not certain whether the various path algorithms require a
pre-noded network or whether they will establish new nodes, so you may wish
to investigate this issue further
1. the north-south road immediately to the west of the point is not
noded at the double line highway
2. the same north-south road ends at the smaller road that sort of
parallels the highway to the north, but that parallel road is not noded
where the north-south road joins it
3. etc
2. you have some double-line roads, which are not wanted; I am
reasonably confident you need to replace them with their "centreline" and
then node that
3. there are duplicate lines, extra lines that don't end cleanly, don't
end precisely on another line, etc, for example in this closeup of the west
end of the highway:
[image: image.png]
I suggest you have some work to do to clean up the extra linework, and
then you may need to node the clean linework.
As to your points, at least the one shown above, it's not on top of a line.
I suggest that, once you have a clean road system, you should at least
ensure your points are on your roads, and you may need to create a node
where the point touches the road line.
You may find these references useful.
https://changelog.qgis.org/en/qgis/lesson/data-acquisition-18/detail/63/?q=9.2
https://docs.qgis.org/3.34/en/docs/user_manual/plugins/core_plugins/plugins_topology_checker.html
https://gis.stackexchange.com/questions/tagged/v.clean
https://docs.qgis.org/3.34/en/docs/training_manual/vector_analysis/network_analysis.html
If your road network includes one-way streets you have more work to do.
This reference may help:
https://plugins.qgis.org/models/30/
Good luck.
> On Tue, Feb 4, 2025 at 2:47 PM chris hermansen <clhermansen at gmail.com>
> wrote:
>
>> Krishna and list,
>>
>> On Tue, Feb 4, 2025 at 12:43 PM krishna Ayyala <ayyalakrishna at gmail.com>
>> wrote:
>>
>>> Chris,
>>> Its nothing to do with the number of points. I got the same error when I
>>> ran with 160 points.I also went to the study manual of v.net.salesman. The
>>> network and points are as per their guidelines.
>>> [image: image.png]
>>>
>>
>> These are different errors. You are supplying at least one incorrect
>> input argument (see the <points> is not a valid parameter) and your input
>> file "outputla.. etc..." is not found.
>>
>> I don't know what else to say, these messages seem pretty
>> self-explanatory and there's no other info here to work with.
>>
>>>
>>> On Tue, Feb 4, 2025 at 1:08 PM chris hermansen <clhermansen at gmail.com>
>>> wrote:
>>>
>>>> Krishna and list,
>>>>
>>>> On Tue, Feb 4, 2025 at 11:49 AM krishna Ayyala <ayyalakrishna at gmail.com>
>>>> wrote:
>>>>
>>>>> I also ran v.clean on the network. Then ran v.net.salesman on the
>>>>> cleaned network. That did not help. Getting the same error message. Is
>>>>> there a fix for this? I wish to run v.net.salesman without any errors.
>>>>>
>>>>> On Tue, Feb 4, 2025 at 12:15 PM krishna Ayyala <
>>>>> ayyalakrishna at gmail.com> wrote:
>>>>>
>>>>>> Chris,
>>>>>> Again thanks for your reply. I am not sure if my network is proper. I
>>>>>> downloaded this from an online data source. How to fix it, if there are any
>>>>>> errors? Are there any tools in qgis to fix this?
>>>>>>
>>>>>> Regards.
>>>>>>
>>>>>> On Tue, Feb 4, 2025 at 12:12 PM chris hermansen <
>>>>>> clhermansen at gmail.com> wrote:
>>>>>>
>>>>>>> Krishna and list,
>>>>>>>
>>>>>>> On Tue, Feb 4, 2025, 10:49 krishna Ayyala <ayyalakrishna at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Chris,
>>>>>>>> Alternatively, I ran v.net.salesman. Even that is giving following
>>>>>>>> error.
>>>>>>>>
>>>>>>>> [image: image.png]
>>>>>>>>
>>>>>>>> [image: image.png]
>>>>>>>>
>>>>>>>>
>>>> Look at the message - Number of cities: 0 / ERROR: Not enough cities (<
>>>> 2)
>>>>
>>>> This tells you that your data is not properly set up.
>>>>
>>>> Study the manual page for v.net.salesman here:
>>>> https://grass.osgeo.org/grass-stable/manuals/v.net.salesman.html
>>>>
>>>> There is a sample of v.net.salesman usage there which explains clearly
>>>> how to set things up. Note creation of cities to visit and use of
>>>> v.net to create the network prior to running v.net.salesman.
>>>>
>>>>
>>>> --
>>>> Chris Hermansen · clhermansen "at" gmail "dot" com
>>>>
>>>> C'est ma façon de parler.
>>>>
>>>
>>
>> --
>> Chris Hermansen · clhermansen "at" gmail "dot" com
>>
>> C'est ma façon de parler.
>>
>
--
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/20250205/a70489e6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 11390 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250205/a70489e6/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 35158 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250205/a70489e6/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 42076 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250205/a70489e6/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 39661 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250205/a70489e6/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 24868 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250205/a70489e6/attachment-0009.png>
More information about the QGIS-User
mailing list