Questions tagged [shortest-path]

The Shortest Path is the shortest or least-cost path from a source or set of sources to a destination or set of destinations. It can often be implemented in vector or raster GIS and is often desired in network analysis such as the shortest path to a location along the road network.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
13 views

Advanced lowest cost path calculation [closed]

I want to calculate the lowest cost path between source and destination points, with advanced criteria. I have ca. 60 source points, which produce water e.g. Source Point 1 produces 50L water. I also ...
  • 1
1 vote
1 answer
10 views

sDNA - sum of traffic along shortest path

I am trying to get a measure or proxy of the estimated aadt encountered along the shortest path. One way would be to compute shortest paths between origins (around 280) and destinations (one) via skim ...
  • 47
1 vote
1 answer
38 views

How to choice a specific direction to get the shortest path

I'd like to know how to choice the left or right direction starting from a point and following a network; in the processing shortest path (from starting point to vector points layer) of QGIS. In this ...
  • 769
1 vote
1 answer
54 views

Error running Shortest path (point to layer) in QGIS

I use QGIS 3.26 with a point and a line layer, representing cities connected by a network. Running QGIS native tool Shortest path (point to layer), I get the following error message: Feature could not ...
  • 45.1k
4 votes
1 answer
365 views

Building the shortest route through all points in QGIS

How to build the shortest route through all selected points, starting from a given point? Which plugin to use? There is a point layer and a linear layer for all routes between points.
  • 49
0 votes
0 answers
34 views

QNEAT3 OD Matrix distance incorrect?

I am currently working on calculating the distances between all pairs of NUTS-2 regions in a road network. To accomplish this I am using the QNEAT3 plugin. It worked very efficiently and I was ...
  • 51
1 vote
0 answers
30 views

Shortest path based on priority

I'm using the geoprocessing "Shortest path (from layer to point)" of QGIS and i'd like to get the shortest path not in the usually way, but based on priority of the routes used. For example, ...
  • 769
0 votes
0 answers
81 views

Find a shortest path from a set of screen coordinates with QGIS

I have a set of screen coordinates whose x axis increase from left to right, and the y axis increase from top to bottom. Example: points = x1,y1;x2,y2;x3,y3;x4,y4........ The coordinates are just a ...
  • 1,007
3 votes
1 answer
52 views

Calculating region pair distances along network in QGIS 3.22.4

I'm currently attempting to calculate the distances between several thousand region pairs (centroids) along the Roman road network in QGIS. I want to achieve something similar to the "Shortest ...
  • 51
0 votes
0 answers
188 views

How to find shortest path point to lpoint using Python?

Suppose I have two coordinates and one shapefile that contains road network (or pipes, or cables, anything). How do I produce the shortest path (line) using Python? The output should be a line that ...
  • 774
4 votes
1 answer
148 views

Automating the selection of starting points in calculation of Shortest path (point to layer) in QGIS

For a letter drop experiment in Germany, I am using QGIS Network Analysis tools to calculate the shortest distances from letter drop points to surrounding postboxes. Using the "Shortest path (...
-1 votes
1 answer
35 views

Vector line length vs. geographical distance (as a bird flies) [closed]

Is there a way to compare the length of a line (ESRI Shapefile in my case) to the actual distance it covers with freely available tools? I am developing an optional path algorithm. The image below ...
3 votes
1 answer
80 views

Creating multiple routes with several stops using QGIS

I am trying to find the shortest paths given a number of points with a specific order for each path. Specifically, my point data have the following format: I used the approved solution given in ...
  • 113
2 votes
0 answers
52 views

Finding shortest line ("arc") traversing a road

Is there any existing method (Qgis plugin, PostGIS etc.) to find the best (shortest) line (arc) to follow in order to traverse a road (represented as polygonal area)? If not, what algorithmic approach ...
  • 1,699
1 vote
1 answer
152 views

Putting coordinates of end point in shortest path algorithm

How do I put the coordinates (x,y) of the end point of the shortest path algorithm (from vector to point) which is part of a QGIS model? I'd like to get the calculated coordinates of a point (with the ...
  • 769
7 votes
3 answers
452 views

Calculating shortest route by road from one origin point to multiple destination points at once using PostGIS (pgrouting)

Referring to the below snapshot what is the best possible way to find the road distance from the red star node to all of the yellow nodes using PostGIS. Note: I don't have the road distance data ...
  • 339
8 votes
2 answers
932 views

Shortest path touching all points

I am looking for a solution to derive the shortest route that touches all the points using Python. Please note that This is not a Travelling salesman problem (TSP), in which the route should end ...
  • 357
5 votes
2 answers
291 views

Shortest paths between points over multiple linestrings

I'd like to calculate the distance between one and multiple other points along a network of LineStrings. I'm aware of this question which calculates the distance on a substring of a LineString, but ...
  • 1,205
2 votes
1 answer
63 views

Shortest path points layer to points layer

i'd like to know how can i get in QGIS the shortest path from a points layer to points layer, according to field values. In QGIS, I've seen only the function "from vector to single point" ...
  • 769
1 vote
0 answers
21 views

Has any research been done into navigability for offroad vehicles for different types of terrain and elevation changes? [closed]

"Navigability" is a pretty broad category, so to be specific, what I mean is, given some GIS data, how can we calculate the cost of moving from point A to point B, in some context? For ...
3 votes
1 answer
84 views

Shortest path (point to point) in iteration, safe for the case there is no route

I am using Network Analysis > Shortest path (point to point) to compute the distance between two points, following a street network. Here is the code: n=0 for f1 in layer1: #Coordinates from ...
  • 65
0 votes
0 answers
348 views

Shortest-path algorithms used in Networkx: what about points not near nodes?

I am new to Networkx, but am I right that Dijkstra's is the algorithm Networkx uses by default? From what I understand, Dijkstra's algorithm traces a shortest path between two nodes on a graph. What, ...
0 votes
1 answer
438 views

Seeing which node has given node ID in osmnx [closed]

I have been reading the documentation on OSMnx and I am trying to use the command osmnx.shortest_path(G, orig, dest, weight = "length") on a graph of a city. I know which nodes I want to ...
1 vote
2 answers
172 views

Alternatives to Network Analyst in ArcGIS for utility network tracing

I have feature classes of lines (roads) and two types of point feature classes (let’s call them “sources” and “sinks”; there are many sinks for every source). For every source, I need to trace the ...
1 vote
1 answer
43 views

Keep line attributes in QGIS Network Analysis - Shortest Path

I'm running a simply Shortest Path task from the Network Analysis toolbox in QGIS, but it seems that the output doesn't transfer the line attributes, only the start layer attributes. I need the road ...
  • 423
0 votes
2 answers
432 views

Calculating road travel distance between point and polygon layers [closed]

I am trying to calculate the top three shortest distances from a point file (buildings) to a polygon file (designated natural areas) via road networks. I basically need the "Join attribute by ...
0 votes
0 answers
32 views

Finding the point closest to a point in another feature class and the paths between them

There are two point feature classes (let's call them Sinks and Sources). Working with ArcGIS Desktop, I need to find, for each Sink, its nearest Source. Normally I'd do a spatial join, but this time I ...
3 votes
0 answers
126 views

Shortest line network route between clusters of points and the cluster centroid

I have a point layer containing clusters of points (premises) that I have grouped using a clustering algorithm (the clusters each having their own unique ID which I have used to create convex hull ...
1 vote
1 answer
214 views

How to calculate the shortest path of adjacent points, from an origin to destination points? (ArcGIS Pro/ArcMap)

For a project I am trying calculate the shortest path (marked by points, not lines) connecting a point of origin to a destination point (different feature layer) and automate this for several segments/...
  • 489
1 vote
1 answer
92 views

Calculating shortest path using two network layers in PyQGIS

Using PyQGIS I can calculate the shortest path from point to point. But I need to calculate the shortest path based on two network layers: A and B. So that the result should be the shortest path from ...
  • 149
1 vote
1 answer
24 views

Editing network for shortest path

I am editing road network to create scenarios but Shortest Path is not recognizing the edits. I am assuming the edited street network is not connecting with other streets at intersections. I have ...
3 votes
3 answers
2k views

Connecting points to lines in order using QGIS

I have a set of points and I want to create lines from them. Points belonging to one line have unique "UniqueID" to be grouped by. I try to use QGIS's "Points to path algorithm". ...
  • 213
3 votes
1 answer
44 views

Compute the number of shortest paths that use a link

I am currently computing shortest path algorithms between two sets of points (origin set and destination set) and a road network, using the plugin QNEAT3. It works and gives me the distances between ...
  • 31
2 votes
0 answers
171 views

QGIS Shortest path (point to layer) start point expression in modeller

When in QGIS I run processing tool Shortest path (point to layer) ... I am satisfied with the result (below picture red line). But when I try to run the same tool in QGIS modeller, the result is ...
  • 381
1 vote
1 answer
70 views

Incorrect Shortest Paths

I compute shortest paths between ports. However, some of the resulting paths are simply incorrect. Consider the following example where coast is multi-polygon object of the planet's landmass (e.g. ...
  • 258
2 votes
0 answers
342 views

Using shortest path pgr_dijkstra

Versions PostGIS Bundle 3 for PostgreSQL x64 12 pgAdmin 4.24 pgrouting 3.1.0 I have also enabled the postgis and pgrouting extensions on a public schema. I am only just starting with pgrouting so I am ...
1 vote
0 answers
55 views

How to connect / 'join' lines selectively but automatically in QGIS

I had a similar problem a while back with How to join (draw new) lines that are close but not touching - large dataset This is the same dataset, however I found a problem with what I did before. The ...
  • 49
1 vote
1 answer
151 views

Shortest path (point to point) when filling out coordinates in boxes

I am using the processing toolbox interface to launch the "Shortest path (point to point)" command to connect two points using a line network layer (see attached photo). If I fill out the ...
  • 31
0 votes
0 answers
149 views

Shortest road route calculation on OpenLayers GeoDjango

I have created a web based GIS application using Django, Mapnik, Mapproxy, OpenLayers 6. Now I need to develop a shortest path(road distance) between two points selected by the user. What is the best ...
  • 61
1 vote
0 answers
21 views

Calculation of intermediate points along shortest path not working correctly

I am trying to implement the calculation of points along the shortest path using the algorithm shown here: LatLng getGreatCirclePoint(double lat1, double lon1, double lat2, double lon2) { double d = ...
  • 111
0 votes
0 answers
164 views

Using pg_routing to connect point to closest point of set of points

Imagine we have the location of a person (point) and 100 restaurants (each is a point). My objective is to calculate the path from the person to the nearest restaurant (just one), but I want to avoid ...
2 votes
0 answers
58 views

Shortest path from one to many points to return path id's using QGIS

I'm trying to find the shortest path between many points (pink) and one point (light green) using a network of lines (dark green). For each path found I need the list of line id's that make that path. ...
1 vote
0 answers
75 views

Qgis Shortest Path Facility problem

My aim is to calculate the shortest distance between two point layers One point layer contains Origin points, the other point layer contains Destination points. Both layers contain more than 100 data ...
  • 11
1 vote
1 answer
72 views

Network Analysis Shortest path with original line segments as output

I've managed to batch run the shortest path algorithm and the shortest route (point to layer) in the output is perfect, except that I really need the individual attribute tables of the line segments ...
  • 11
2 votes
0 answers
67 views

Shortest path for a series of points

I have a points layer with bus stop locations and a line layer which represents the road network. I want to find the shortest path for each bus route based on the sequence of bus stops and save the ...
0 votes
1 answer
40 views

PGRouting Error Missing table?

I am trying to use pgrouting to find the shortest path in GeoServer. So I created new layer in sql view but its giving me error. I created 3 table in database: at_2po_4pgr = main table ...
0 votes
0 answers
30 views

Shortest path not recognising network as connected

I'm trying to use a grid network that I have created to find the shortest path between two points accounting for directional wind-speed. The problem I'm running into is that the shortest path feature ...
1 vote
1 answer
62 views

Problem with QGIS Network Analyst (Basic)

I'm going through the QGIS training, Lesson: Network Analysis, and I've encountered a problem with Network Analyst. When I open the Shortest Path (Pt to Pt) tool, I can set the Vector layer ...
  • 39
1 vote
1 answer
415 views

Transition Function Inputs

I would like to define my own gdistance::transition function. However, there are two issues that I aren't clear to me yet. First, I do not yet understand what the input vector to this transition() ...
4 votes
0 answers
124 views

Shortest path (point to point) in iteration

I am using Network Analysis-> Shortest path (point to point) to compute the distance between two points, following a network from OSM. It works like magic for single requests, but I do not seem to be ...
  • 103